public class AccoundDaoThis returns an array of all the documents whose identities array contains at least the string identity.
{
....
private List< String > identities;
....
}
public List<
Account > readAllByIdentity( String identity )
{
List< Account > list =
new ArrayList< Account >();
BasicDBObject query =
new BasicDBObject();
query.put( "identities",
identity );
query.put( "forgotten",
false );
DBCursor cursor =
getCollection().find( query );
while( cursor.hasNext() )
{
DBObject dbo
= cursor.next();
Account
account = new Account();
account.makePojoFromBson( dbo );
list.add( account
);
}
return list;
}
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.