Is the $query operator obsolete in 3.4.6 ?

78 views
Skip to first unread message

olis...@gmail.com

unread,
Jan 6, 2018, 2:08:25 AM1/6/18
to mongodb-user
Is the $query operator obsolete in 3.4.6 ?
Below is my test: pradb>db.t1225_1.find( { $query: { age : 25 } } ) Error: error: { "ok" : 0, "errmsg" : "unknown top level operator: $query", "code" : 2, "codeName" : "BadValue" } Is the $query operator obsolete in 3.4.6 ? If it is the fact, From which version ?

Stephen Steneker

unread,
Jan 22, 2018, 10:42:57 PM1/22/18
to mongodb-user
On Saturday, 6 January 2018 18:08:25 UTC+11, olisehrac write:
Is the $query operator obsolete in 3.4.6 ?

Hi,

Support for the older $query syntax was removed in the MongoDB 3.2 shell as part of the work for SERVER-15176 (New commands for find and getMore).

>db.t1225_1.find( { $query: { age : 25 } } )

Supported syntax for your query would be: db.t1225_1.find( { age : 25 } ).

Regards,
Stennie
Reply all
Reply to author
Forward
0 new messages