| Modifier and Type | Method and Description |
|---|---|
| public AddStatement | Returns: AddStatementmap of key-value parameters representing the document fields doc)Add a document in the form of a Map. |
| public AddStatement | Returns: AddStatementone or more documents given as JSON strings jsonStrings)Add one or more documents. |
| public AddStatement | |
| public AddStatement | Returns: AddStatementone or more documents given as documents)DbDocAdd a sequence of documents. |
| public Result | Returns: Result object, which will indicate the number of affected documents (0 - if none, 1 - if added, 2 - if replaced)the document id of the document to be replaced id, DbDoc the new document, which may contain expressions. If doc contains an _id value and it does not match the given id then the error
will be thrown. doc)Adds the document to the collection. |
| public Result | Returns: Result object, which will indicate the number of affected documents (0 - if none, 1 - if added, 2 - if replaced)the document id of the document to be replaced id, String the new document, given as JSON string, which may contain expressions. If doc contains an _id value and it does not match the given id then
the error will be thrown. jsonString)Adds the document to the collection. |
| public long | Returns: The number of documents in this collectionQuery the number of documents in this collection. |
| public Result | Returns: Resultindex name indexName, DbDoc JSON document with the following fields:
indexDefinition)
Create a new statement defining the creation of an index on this collection. |
| public Result | Returns: Resultindex name indexName, String JSON document with the following fields:
jsonIndexDefinition)
Create a new statement defining the creation of an index on this collection. |
| public void | |
| public FindStatement | |
| public FindStatement | Returns: FindStatementcondition expression searchCondition)Create a new find statement retrieving documents matching the given search condition. |
| public DbDoc | |
| public ModifyStatement | Returns: ModifyStatementcondition expression searchCondition)Create a new modify statement affecting documents matching the given search condition. |
| public DbDoc | |
| public RemoveStatement | Returns: RemoveStatementcondition expression searchCondition)Create a new removal statement affecting documents matching the given search condition. |
| public Result | |
| public Result | Returns: Result object, which will indicate the number of affected documents (1 or 0, if none)the document id of the document to be replaced id, DbDoc the new document, which may contain expressions. If document contains an _id value, it is ignored. doc)Takes in a document object that will replace the matching document. |
| public Result | Returns: Result object, which will indicate the number of affected documents (1 or 0, if none)the document id of the document to be replaced id, String the new document, given as JSON string, which may contain expressions. If document contains an _id value, it is ignored. jsonString)Takes in a document object that will replace the matching document. |
| add | back to summary |
|---|---|
| public AddStatement add(Map<String, ?> doc) Add a document in the form of a Map.
| |
| add | back to summary |
|---|---|
| public AddStatement add(String... jsonStrings) Add one or more documents.
| |
| add | back to summary |
|---|---|
| public AddStatement add(DbDoc document) Add a document in the form of a DbDoc.
| |
| add | back to summary |
|---|---|
| public AddStatement add(DbDoc... documents) Add a sequence of documents.
| |
| addOrReplaceOne | back to summary |
|---|---|
| public Result addOrReplaceOne(String id, DbDoc doc) Adds the document to the collection. The following algorithm applies:
| |
| addOrReplaceOne | back to summary |
|---|---|
| public Result addOrReplaceOne(String id, String jsonString) Adds the document to the collection. The following algorithm applies:
| |
| count | back to summary |
|---|---|
| public long count() Query the number of documents in this collection.
| |
| createIndex | back to summary |
|---|---|
| public Result createIndex(String indexName, DbDoc indexDefinition) Create a new statement defining the creation of an index on this collection. Example: collection.createIndex("myIndex", "{\"fields\": [{\"field\": \"$.myGeoJsonField\", \"type\": \"GEOJSON\", \"required\": true, \"options\": 2, \"srid\": 4326}], \"type\":\"SPATIAL\"}");
| |
| createIndex | back to summary |
|---|---|
| public Result createIndex(String indexName, String jsonIndexDefinition) Create a new statement defining the creation of an index on this collection. Example: collection.createIndex("myIndex", "{\"fields\": [{\"field\": \"$.myGeoJsonField\", \"type\": \"GEOJSON\", \"required\": true, \"options\": 2, \"srid\": 4326}], \"type\":\"SPATIAL\"}");
| |
| dropIndex | back to summary |
|---|---|
| public void dropIndex(String indexName) Create a new statement defining the removal of an index on this collection.
| |
| find | back to summary |
|---|---|
| public FindStatement find() Create a new find statement retrieving all documents in the collection.
| |
| find | back to summary |
|---|---|
| public FindStatement find(String searchCondition) Create a new find statement retrieving documents matching the given search condition.
| |
| getOne | back to summary |
|---|---|
| public DbDoc getOne(String id) Return the document with the given id. | |
| modify | back to summary |
|---|---|
| public ModifyStatement modify(String searchCondition) Create a new modify statement affecting documents matching the given search condition.
| |
| newDoc | back to summary |
|---|---|
| public DbDoc newDoc() Create a new document. | |
| remove | back to summary |
|---|---|
| public RemoveStatement remove(String searchCondition) Create a new removal statement affecting documents matching the given search condition.
| |
| removeOne | back to summary |
|---|---|
| public Result removeOne(String id) Removes the document with the given id. | |
| replaceOne | back to summary |
|---|---|
| public Result replaceOne(String id, DbDoc doc) Takes in a document object that will replace the matching document. If no matches are found, the function returns normally with no changes being made. | |
| replaceOne | back to summary |
|---|---|
| public Result replaceOne(String id, String jsonString) Takes in a document object that will replace the matching document. If no matches are found, the function returns normally with no changes being made.
| |