Package | Description |
---|---|
org.mongodb.morphia | |
org.mongodb.morphia.aggregation | |
org.mongodb.morphia.dao | |
org.mongodb.morphia.query | |
org.mongodb.morphia.utils |
Modifier and Type | Method and Description |
---|---|
Query<T> |
MapreduceResults.createQuery() |
<T> Query<T> |
Datastore.createQuery(Class<T> kind)
Returns a new query bound to the kind (a specific
DBCollection ) |
<T> Query<T> |
DatastoreImpl.createQuery(Class<T> type) |
<T> Query<T> |
DatastoreImpl.createQuery(Class<T> type,
com.mongodb.DBObject q) |
<T> Query<T> |
AdvancedDatastore.createQuery(Class<T> kind,
com.mongodb.DBObject q) |
<T> Query<T> |
DatastoreImpl.createQuery(String kind,
Class<T> type) |
<T> Query<T> |
AdvancedDatastore.createQuery(String kind,
Class<T> clazz) |
<T> Query<T> |
DatastoreImpl.createQuery(String kind,
Class<T> type,
com.mongodb.DBObject q) |
<T> Query<T> |
AdvancedDatastore.createQuery(String kind,
Class<T> clazz,
com.mongodb.DBObject q) |
<T> Query<T> |
Datastore.find(Class<T> clazz)
Find all instances by type
|
<T> Query<T> |
DatastoreImpl.find(Class<T> clazz) |
<T,V> Query<T> |
Datastore.find(Class<T> clazz,
String property,
V value)
Find all instances by collectionName, and filter property.
|
<T,V> Query<T> |
DatastoreImpl.find(Class<T> clazz,
String property,
V value) |
<T,V> Query<T> |
Datastore.find(Class<T> clazz,
String property,
V value,
int offset,
int size)
Find all instances by collectionName, and filter property.
|
<T,V> Query<T> |
DatastoreImpl.find(Class<T> clazz,
String property,
V value,
int offset,
int size) |
<T> Query<T> |
DatastoreImpl.find(String kind,
Class<T> clazz) |
<T> Query<T> |
AdvancedDatastore.find(String kind,
Class<T> clazz) |
<T,V> Query<T> |
DatastoreImpl.find(String kind,
Class<T> clazz,
String property,
V value,
int offset,
int size) |
<T,V> Query<T> |
AdvancedDatastore.find(String kind,
Class<T> clazz,
String property,
V value,
int offset,
int size) |
<T,V> Query<T> |
DatastoreImpl.find(String kind,
Class<T> clazz,
String property,
V value,
int offset,
int size,
boolean validate) |
<T,V> Query<T> |
Datastore.get(Class<T> clazz,
Iterable<V> ids)
Find the given entities (by id); shorthand for
find("_id in", ids) |
<T,V> Query<T> |
DatastoreImpl.get(Class<T> clazz,
Iterable<V> ids) |
<T> Query<T> |
DatastoreImpl.queryByExample(String kind,
T ex) |
<T> Query<T> |
AdvancedDatastore.queryByExample(String kind,
T example)
Returns a new query based on the example object
|
<T> Query<T> |
Datastore.queryByExample(T example)
Returns a new query based on the example object
|
<T> Query<T> |
DatastoreImpl.queryByExample(T ex) |
Modifier and Type | Method and Description |
---|---|
<T> com.mongodb.WriteResult |
Datastore.delete(Query<T> q)
Deletes the given entities based on the query
|
<T> com.mongodb.WriteResult |
DatastoreImpl.delete(Query<T> query) |
<T> com.mongodb.WriteResult |
Datastore.delete(Query<T> q,
com.mongodb.WriteConcern wc)
Deletes the given entities based on the query, with the WriteConcern
|
<T> com.mongodb.WriteResult |
DatastoreImpl.delete(Query<T> query,
com.mongodb.WriteConcern wc) |
<T> T |
Datastore.findAndDelete(Query<T> q)
Deletes the given entities based on the query (first item only).
|
<T> T |
DatastoreImpl.findAndDelete(Query<T> qi) |
<T> T |
Datastore.findAndModify(Query<T> q,
UpdateOperations<T> ops)
Find the first Entity from the Query, and modify it.
|
<T> T |
DatastoreImpl.findAndModify(Query<T> q,
UpdateOperations<T> ops) |
<T> T |
Datastore.findAndModify(Query<T> q,
UpdateOperations<T> ops,
boolean oldVersion)
Find the first Entity from the Query, and modify it.
|
<T> T |
DatastoreImpl.findAndModify(Query<T> query,
UpdateOperations<T> ops,
boolean oldVersion) |
<T> T |
Datastore.findAndModify(Query<T> q,
UpdateOperations<T> ops,
boolean oldVersion,
boolean createIfMissing)
Find the first Entity from the Query, and modify it.
|
<T> T |
DatastoreImpl.findAndModify(Query<T> qi,
UpdateOperations<T> ops,
boolean oldVersion,
boolean createIfMissing) |
<T> long |
Datastore.getCount(Query<T> query)
Gets the count of items returned by this query; same as
query.countAll() |
<T> long |
DatastoreImpl.getCount(Query<T> query) |
<T> MapreduceResults<T> |
Datastore.mapReduce(MapreduceType type,
Query q,
Class<T> outputType,
com.mongodb.MapReduceCommand baseCommand)
Runs a map/reduce job at the server; this should be used with a server version 1.7.4 or higher
|
<T> MapreduceResults<T> |
DatastoreImpl.mapReduce(MapreduceType type,
Query query,
Class<T> outputType,
com.mongodb.MapReduceCommand baseCommand) |
<T> MapreduceResults<T> |
Datastore.mapReduce(MapreduceType type,
Query q,
String map,
String reduce,
String finalize,
Map<String,Object> scopeFields,
Class<T> outputType)
Runs a map/reduce job at the server; this should be used with a server version 1.7.4 or higher
|
<T> MapreduceResults<T> |
DatastoreImpl.mapReduce(MapreduceType type,
Query query,
String map,
String reduce,
String finalize,
Map<String,Object> scopeFields,
Class<T> outputType) |
<T> UpdateResults |
Datastore.update(Query<T> query,
UpdateOperations<T> ops)
updates all entities found with the operations; this is an atomic operation per entity
|
<T> UpdateResults |
DatastoreImpl.update(Query<T> query,
UpdateOperations<T> ops) |
<T> UpdateResults |
Datastore.update(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing)
updates all entities found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true; this
is an atomic operation per entity
|
<T> UpdateResults |
DatastoreImpl.update(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing) |
<T> UpdateResults |
Datastore.update(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing,
com.mongodb.WriteConcern wc) |
<T> UpdateResults |
DatastoreImpl.update(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing,
com.mongodb.WriteConcern wc) |
<T> UpdateResults |
Datastore.updateFirst(Query<T> query,
T entity,
boolean createIfMissing)
updates the first entity found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true;
this is an atomic operation per entity
|
<T> UpdateResults |
DatastoreImpl.updateFirst(Query<T> query,
T entity,
boolean createIfMissing) |
<T> UpdateResults |
Datastore.updateFirst(Query<T> query,
UpdateOperations<T> ops)
updates the first entity found with the operations; this is an atomic operation
|
<T> UpdateResults |
DatastoreImpl.updateFirst(Query<T> query,
UpdateOperations<T> ops) |
<T> UpdateResults |
Datastore.updateFirst(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing)
updates the first entity found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true;
this is an atomic operation per entity
|
<T> UpdateResults |
DatastoreImpl.updateFirst(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing) |
<T> UpdateResults |
Datastore.updateFirst(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing,
com.mongodb.WriteConcern wc) |
<T> UpdateResults |
DatastoreImpl.updateFirst(Query<T> query,
UpdateOperations<T> ops,
boolean createIfMissing,
com.mongodb.WriteConcern wc) |
Modifier and Type | Method and Description |
---|---|
Query |
GeoNear.getQuery() |
Modifier and Type | Method and Description |
---|---|
AggregationPipeline |
AggregationPipeline.match(Query query)
Filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage.
|
AggregationPipeline |
AggregationPipelineImpl.match(Query query) |
GeoNear.GeoNearBuilder |
GeoNear.GeoNearBuilder.setQuery(Query query)
Limits the results to the documents that match the query.
|
Modifier and Type | Method and Description |
---|---|
Query<T> |
BasicDAO.createQuery() |
Query<T> |
DAO.createQuery()
Starts a query for this DAO entities type
|
Modifier and Type | Method and Description |
---|---|
long |
BasicDAO.count(Query<T> q) |
long |
DAO.count(Query<T> q)
returns the count which match the criteria
|
com.mongodb.WriteResult |
BasicDAO.deleteByQuery(Query<T> q) |
com.mongodb.WriteResult |
DAO.deleteByQuery(Query<T> q)
Saves the entities given the query
|
boolean |
BasicDAO.exists(Query<T> q) |
boolean |
DAO.exists(Query<T> q)
checks for entities which match the criteria
|
QueryResults<T> |
BasicDAO.find(Query<T> q) |
QueryResults<T> |
DAO.find(Query<T> q)
returns the entities which match the criteria
|
List<K> |
BasicDAO.findIds(Query<T> q) |
List<K> |
DAO.findIds(Query<T> q)
Finds the entities Ts by the criteria {key:value}
|
T |
BasicDAO.findOne(Query<T> q) |
T |
DAO.findOne(Query<T> q)
returns the entity which match the criteria
|
Key<T> |
BasicDAO.findOneId(Query<T> query) |
Key<T> |
DAO.findOneId(Query<T> q)
Finds the first entity's ID
|
UpdateResults |
BasicDAO.update(Query<T> q,
UpdateOperations<T> ops) |
UpdateResults |
DAO.update(Query<T> q,
UpdateOperations<T> ops)
Updates all entities matched by the constraints with the modifiers supplied.
|
UpdateResults |
BasicDAO.updateFirst(Query<T> q,
UpdateOperations<T> ops) |
UpdateResults |
DAO.updateFirst(Query<T> q,
UpdateOperations<T> ops)
Updates the first entity matched by the constraints with the modifiers supplied.
|
Modifier and Type | Class and Description |
---|---|
class |
QueryImpl<T>
Implementation of Query
|
Modifier and Type | Method and Description |
---|---|
Query<T> |
Query.batchSize(int value)
Batch-size of the fetched result (cursor).
|
Query<T> |
QueryImpl.batchSize(int value) |
Query<T> |
Query.cloneQuery()
Creates and returns a copy of this
Query . |
Query<T> |
Query.comment(String comment)
This makes it possible to attach a comment to a query.
|
Query<T> |
QueryImpl.comment(String comment) |
<T> Query<T> |
QueryFactory.createQuery(Datastore datastore)
Creates an unvalidated
Query typically for use in aggregation pipelines. |
<T> Query<T> |
AbstractQueryFactory.createQuery(Datastore datastore) |
<T> Query<T> |
QueryFactory.createQuery(Datastore datastore,
com.mongodb.DBCollection collection,
Class<T> type)
Creates and returns a
Query for the given arguments. |
<T> Query<T> |
AbstractQueryFactory.createQuery(Datastore datastore,
com.mongodb.DBCollection collection,
Class<T> type) |
<T> Query<T> |
QueryFactory.createQuery(Datastore datastore,
com.mongodb.DBCollection collection,
Class<T> type,
com.mongodb.DBObject query)
Creates and returns a
Query for the given arguments. |
<T> Query<T> |
DefaultQueryFactory.createQuery(Datastore datastore,
com.mongodb.DBCollection collection,
Class<T> type,
com.mongodb.DBObject query)
Creates and returns a
QueryImpl . |
Query<T> |
Query.disableCursorTimeout()
Disables cursor timeout on server.
|
Query<T> |
QueryImpl.disableCursorTimeout()
Disables cursor timeout on server.
|
Query<T> |
Query.disableSnapshotMode()
Disable snapshotted mode (default mode).
|
Query<T> |
QueryImpl.disableSnapshotMode()
Disable snapshotted mode (default mode).
|
Query<T> |
Query.disableValidation()
Turns off validation (for all calls made after)
|
Query<T> |
QueryImpl.disableValidation() |
Query<T> |
Query.enableCursorTimeout()
Enables cursor timeout on server.
|
Query<T> |
QueryImpl.enableCursorTimeout()
Enables cursor timeout on server.
|
Query<T> |
Query.enableSnapshotMode()
Enabled snapshotted mode where duplicate results (which may be updated during the lifetime of the cursor) will not be returned.
|
Query<T> |
QueryImpl.enableSnapshotMode()
Enabled snapshotted mode where duplicate results (which may be updated during the lifetime of the cursor) will not be returned.
|
Query<T> |
Query.enableValidation()
Turns on validation (for all calls made after); by default validation is on
|
Query<T> |
QueryImpl.enableValidation() |
Query<T> |
Query.filter(String condition,
Object value)
Create a filter based on the specified condition and value.
|
Query<T> |
QueryImpl.filter(String condition,
Object value) |
Query<T> |
Query.hintIndex(String idxName)
Hints as to which index should be used.
|
Query<T> |
QueryImpl.hintIndex(String idxName) |
Query<T> |
Query.limit(int value)
Limit the fetched result set to a certain number of values.
|
Query<T> |
QueryImpl.limit(int value) |
Query<T> |
Query.lowerIndexBound(com.mongodb.DBObject lowerBound)
Specify the inclusive lower bound for a specific index in order to constrain the results of this query.
|
Query<T> |
QueryImpl.lowerIndexBound(com.mongodb.DBObject lowerBound) |
Query<T> |
Query.maxScan(int value)
Constrains the query to only scan the specified number of documents when fulfilling the query.
|
Query<T> |
QueryImpl.maxScan(int value) |
Query<T> |
Query.maxTime(long maxTime,
TimeUnit maxTimeUnit)
Specifies a time limit for executing the query.
|
Query<T> |
QueryImpl.maxTime(long value,
TimeUnit timeUnitValue) |
Query<T> |
Query.offset(int value)
Starts the query results at a particular zero-based offset.
|
Query<T> |
QueryImpl.offset(int value) |
Query<T> |
Query.order(String condition)
Sorts based on a property (defines return order).
|
Query<T> |
QueryImpl.order(String condition) |
Query<T> |
Query.queryNonPrimary()
Deprecated.
use #useReadPreference(ReadPreference) instead
|
Query<T> |
QueryImpl.queryNonPrimary() |
Query<T> |
Query.queryPrimaryOnly()
Deprecated.
use #useReadPreference(ReadPreference)
|
Query<T> |
QueryImpl.queryPrimaryOnly() |
Query<T> |
Query.retrievedFields(boolean include,
String... fields)
Limits the fields retrieved
|
Query<T> |
QueryImpl.retrievedFields(boolean include,
String... list) |
Query<T> |
Query.retrieveKnownFields()
Limits the fields retrieved to those of the query type -- dangerous with interfaces and abstract classes
|
Query<T> |
QueryImpl.retrieveKnownFields() |
Query<T> |
Query.returnKey()
Only return the index field or fields for the results of the query.
|
Query<T> |
QueryImpl.returnKey() |
Query<T> |
Query.search(String text)
Perform a text search on the content of the fields indexed with a text index..
|
Query<T> |
QueryImpl.search(String search) |
Query<T> |
Query.search(String text,
String language)
Perform a text search on the content of the fields indexed with a text index..
|
Query<T> |
QueryImpl.search(String search,
String language) |
Query<T> |
Query.upperIndexBound(com.mongodb.DBObject upperBound)
Specify the exclusive upper bound for a specific index in order to constrain the results of this query.
|
Query<T> |
QueryImpl.upperIndexBound(com.mongodb.DBObject upperBound) |
Query<T> |
Query.useReadPreference(com.mongodb.ReadPreference readPref)
Route query ReadPreference
|
Query<T> |
QueryImpl.useReadPreference(com.mongodb.ReadPreference readPref) |
Query<T> |
Query.where(org.bson.types.CodeWScope js)
Limit the query using this javascript block; only one per query
|
Query<T> |
QueryImpl.where(org.bson.types.CodeWScope js) |
Query<T> |
Query.where(String js)
Limit the query using this javascript block; only one per query
|
Query<T> |
QueryImpl.where(String js) |
Modifier and Type | Method and Description |
---|---|
FieldEnd<? extends Query<T>> |
Query.field(String field)
Fluent query interface:
createQuery(Ent.class).field("count").greaterThan(7)... |
FieldEnd<? extends Query<T>> |
QueryImpl.field(String name) |
Modifier and Type | Method and Description |
---|---|
static com.mongodb.DBCollection |
Helper.getCollection(Query q) |
static com.mongodb.DBObject |
Helper.getCriteria(Query q) |
static com.mongodb.DBObject |
Helper.getFields(Query q) |
static com.mongodb.DBObject |
Helper.getSort(Query q) |
Copyright © 2016. All rights reserved.