I need to know how to use where in MongoDB queries using Java Driver.
SELECT COLUMN1, COLUMN2 WHERE COLOUM3 = 'KeyWord';
I have a key Name and its value, and i want to find some other key/value. I think i can use $where for that. But, i dont know its syntax in java.
How shall i use where in my mongo queries?
Any suggestions would be appreciative!!!!
Thanks!
You shouldn’t generally need to use $where …
You should be using the “document-style query” find()
Basically find() is MongoDB’s version of where …
If you have a collection called mycollection and a attribute called attribute1 (this is exactly like your COLUMN1)
So to get results like this SQL query …
Via the MongoDB shell, you’d use find() like so …
You really shouldn’t need to use $where for most any normal mongodb query.
Lots more help here: http://www.mongodb.org/display/DOCS/Querying