public interface Writer
MorphiumConfig| Modifier and Type | Method and Description |
|---|---|
void |
delete(List lst) |
void |
delete(Object o) |
void |
delete(Query q)
deletes all objects matching the given query
|
void |
inc(Object toInc,
String field,
int amount)
Increases a value in an existing mongo collection entry - no reading necessary.
|
void |
inc(Query<?> query,
String field,
int amount,
boolean insertIfNotExist,
boolean multiple) |
void |
pushPull(boolean push,
Query<?> query,
String field,
Object value,
boolean insertIfNotExist,
boolean multiple) |
void |
pushPullAll(boolean push,
Query<?> query,
String field,
List<?> value,
boolean insertIfNotExist,
boolean multiple) |
void |
set(Object toSet,
String field,
Object value)
changes an object in DB
|
void |
set(Query<?> query,
Map<String,Object> values,
boolean insertIfNotExist,
boolean multiple)
will change an entry in mongodb-collection corresponding to given class object
if query is too complex, upsert might not work!
|
void |
setMorphium(Morphium m) |
void |
store(List lst)
stores the given list of objects, should be entities or embedded
|
void |
store(Object o)
Stores the object, should be an entity
|
void |
storeUsingFields(Object ent,
String... fields)
update an object using fields specified
|
void |
unset(Object toSet,
String field)
Un-setting a value in an existing mongo collection entry - no reading necessary.
|
void store(Object o)
o - void store(List lst)
lst - void storeUsingFields(Object ent, String... fields)
ent - fields - void set(Object toSet, String field, Object value)
toSet - field - value - void set(Query<?> query, Map<String,Object> values, boolean insertIfNotExist, boolean multiple)
query - - query to specify which objects should be setvalues - - map fieldName->Value, which values are to be set!insertIfNotExist - - insert, if it does not exist (query needs to be simple!)multiple - - update several documents, if false, only first hit will be updatedvoid inc(Object toInc, String field, int amount)
toInc: - object to set the value in (or better - the corresponding entry in mongo)field: - the field to changeamount: - the value to setvoid setMorphium(Morphium m)
void delete(List lst)
void delete(Object o)
void delete(Query q)
q - void pushPull(boolean push,
Query<?> query,
String field,
Object value,
boolean insertIfNotExist,
boolean multiple)
void pushPullAll(boolean push,
Query<?> query,
String field,
List<?> value,
boolean insertIfNotExist,
boolean multiple)
void unset(Object toSet, String field)
toSet: - object to set the value in (or better - the corresponding entry in mongo)field: - field to remove from documentCopyright © 2012. All Rights Reserved.