Re: mongodb problems with andoperator

77 views
Skip to first unread message

Jeremy Mikola

unread,
Oct 2, 2012, 4:41:59 PM10/2/12
to mongod...@googlegroups.com
You should be able to use the BasicDBObject.toString() method to export the query as JSON, which you can then copy/paste into the shell. Have you tried running that outside of the Java application and confirming if it yields the expected results?

Your second code example looks correct when compared to one of the answers in http://stackoverflow.com/questions/10444038/mongo-db-query-in-java. The only difference is that you were using a BasicDBList instead of an ArrayList in the SO example, which I don't think is reason for concern.

Reply all
Reply to author
Forward
0 new messages