I am learning MongoDB and found that I got "invalid operator: $elemMatch"
whenever I use $elemMatch in the query no matter I follow the example in
"Seven Database in Seven Weeks" or following MongoDB Advanced Query
tutorial. The followings are excerpt.
> db.documents.insert( {
... Name: "name1",
... Identifiers: [
... { name: "manufacturer26", value: "abc123" },
... { name: "store5", value: "tty3" },
... { name: "factory3", value: "521" }
... ]
... } );
> db.documents.find( { "Identifiers": {$elemMatch: { name: "store5", value:
"tty3" } } } );
error: { "$err" : "invalid operator: $elemMatch" }
I have the most recent version (2.2.0) of MongoDB. Did I miss something?
How do I get it to work?
Thanks.