public interface DocSaver
| Modifier and Type | Interface and Description |
|---|---|
static class |
DocSaver.Op |
| Modifier and Type | Method and Description |
|---|---|
void |
saveDoc(com.redhat.lightblue.crud.CRUDOperationContext ctx,
DocSaver.Op op,
boolean upsert,
com.mongodb.DBCollection collection,
com.redhat.lightblue.metadata.EntityMetadata md,
com.mongodb.DBObject dbObject,
com.redhat.lightblue.crud.DocCtx inputDoc)
Inserts or saves a doc
|
void saveDoc(com.redhat.lightblue.crud.CRUDOperationContext ctx,
DocSaver.Op op,
boolean upsert,
com.mongodb.DBCollection collection,
com.redhat.lightblue.metadata.EntityMetadata md,
com.mongodb.DBObject dbObject,
com.redhat.lightblue.crud.DocCtx inputDoc)
ctx - Operation contextop - insert or saveupsert - Whether to insert if the document is not in dbcollection - The MongoDB collection to which documents will be
inserted or savedmd - Entity metadatadbObject - Document to insert/saveinputDoc - The input document
The implementation should insert or save the document to the collection.
If operation is insert, the document is inserted, and the _id is returned
in the output document of inputDoc. If the operation is save, and the
document to be saved has _id, the document is attempted to be updated in
the db. If the db does not have the document but upsert=true, document is
inserted. Otherwise, update fails.Copyright © 2014. All rights reserved.