/** * Queries for all objects in this collection. * * @return a cursor which will iterate over every object * @throws MongoException * If an error occurred */ public org.mongojack.DBCursor<T> find() throws MongoException { return new org.mongojack.DBCursor<T>(this, dbCollection.find()); }
/** * Creates a copy of an existing database cursor. The new cursor is an * iterator, even if the original was an array. * * @return the new cursor */ public DBCursor<T> copy() { return new DBCursor<T>(jacksonDBCollection, cursor.copy()); }
/** * Queries for an object in this collection. * * @param query * object for which to search * @return an iterator over the results * @throws MongoException * If an error occurred */ public org.mongojack.DBCursor<T> find(DBObject query) throws MongoException { return new org.mongojack.DBCursor<T>(this, dbCollection.find(serializeFields(query))); }
/** * Queries for an object in this collection. * * @param query * object for which to search * @return an iterator over the results * @throws MongoException * If an error occurred */ public org.mongojack.DBCursor<T> find(DBQuery.Query query) throws MongoException { return new org.mongojack.DBCursor<T>(this, dbCollection.find(serializeQuery(query))); }
/** * Queries for an object in this collection. * <p> * <p> * An empty DBObject will match every document in the collection. Regardless of fields specified, the _id fields are * always returned. * </p> * To keys object should have non null values for every key that you want to * return * * @param query * object for which to search * @param keys * fields to return * @return a cursor to iterate over results */ public org.mongojack.DBCursor<T> find(DBQuery.Query query, DBObject keys) { return new org.mongojack.DBCursor<T>(this, dbCollection.find( serializeQuery(query), keys)); }
/** * Queries for an object in this collection. * <p> * <p> * An empty DBObject will match every document in the collection. Regardless of fields specified, the _id fields are * always returned. * </p> * <p> * An example that returns the "x" and "_id" fields for every document in the collection that has an "x" field: * </p> * * <pre> * BasicDBObject keys = new BasicDBObject(); * keys.put("x", 1); * * DBCursor cursor = collection.find(new BasicDBObject(), keys); * </pre> * * @param query * object for which to search * @param keys * fields to return * @return a cursor to iterate over results */ public org.mongojack.DBCursor<T> find(DBObject query, DBObject keys) { return new org.mongojack.DBCursor<T>(this, dbCollection.find( serializeFields(query), keys)); }