File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes MongoDB and the fly likes MongoDB $in with $and Query in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » MongoDB
Bookmark "MongoDB $in with $and Query in Java" Watch "MongoDB $in with $and Query in Java" New topic
Author

MongoDB $in with $and Query in Java

Charlie Green
Greenhorn

Joined: Jun 29, 2013
Posts: 6
Is this type of query possible?

I need to query the database for data for a specified date for a set of specified stocks. So the data needs to have "this" date and be one of "these" symbols.

I have the following code:


This always comes up null. Can someone explain how to make a query like this work?
Charlie Green
Greenhorn

Joined: Jun 29, 2013
Posts: 6
I found a solution in case anyone else needs to do something similar:

 
jQuery in Action, 2nd edition
 
subject: MongoDB $in with $and Query in Java