public final class MongoCollectionExecutor extends Object
Modifier and Type | Method and Description |
---|---|
<T> com.landawn.abacus.util.stream.Stream<T> |
aggregate(Class<T> targetClass,
List<? extends org.bson.conversions.Bson> pipeline) |
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
aggregate(List<? extends org.bson.conversions.Bson> pipeline) |
AsyncMongoCollectionExecutor |
async() |
int |
bulkInsert(Collection<?> entities) |
int |
bulkInsert(Collection<?> entities,
com.mongodb.client.model.BulkWriteOptions options) |
com.mongodb.bulk.BulkWriteResult |
bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests) |
com.mongodb.bulk.BulkWriteResult |
bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests,
com.mongodb.client.model.BulkWriteOptions options) |
com.mongodb.client.MongoCollection<org.bson.Document> |
coll() |
long |
count() |
long |
count(org.bson.conversions.Bson filter) |
long |
count(org.bson.conversions.Bson filter,
com.mongodb.client.model.CountOptions options) |
com.mongodb.client.result.DeleteResult |
delete(org.bson.types.ObjectId objectId) |
com.mongodb.client.result.DeleteResult |
delete(String objectId) |
com.mongodb.client.result.DeleteResult |
deleteAll(org.bson.conversions.Bson filter) |
com.mongodb.client.result.DeleteResult |
deleteAll(org.bson.conversions.Bson filter,
com.mongodb.client.model.DeleteOptions options) |
com.mongodb.client.result.DeleteResult |
deleteOne(org.bson.conversions.Bson filter) |
com.mongodb.client.result.DeleteResult |
deleteOne(org.bson.conversions.Bson filter,
com.mongodb.client.model.DeleteOptions options) |
<T> com.landawn.abacus.util.stream.Stream<T> |
distinct(Class<T> targetClass,
String fieldName) |
<T> com.landawn.abacus.util.stream.Stream<T> |
distinct(Class<T> targetClass,
String fieldName,
org.bson.conversions.Bson filter) |
boolean |
exists(org.bson.conversions.Bson filter) |
boolean |
exists(org.bson.types.ObjectId objectId) |
boolean |
exists(String objectId) |
com.landawn.abacus.util.u.Optional<org.bson.Document> |
findFirst(org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.util.u.Optional<T> |
findFirst(Class<T> targetClass,
org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.util.u.Optional<T> |
findFirst(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection) |
<T> com.landawn.abacus.util.u.Optional<T> |
findFirst(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.util.u.Optional<T> |
findFirst(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort) |
<T> com.landawn.abacus.util.u.Optional<T> |
get(Class<T> targetClass,
org.bson.types.ObjectId objectId) |
<T> com.landawn.abacus.util.u.Optional<T> |
get(Class<T> targetClass,
org.bson.types.ObjectId objectId,
Collection<String> selectPropNames) |
<T> com.landawn.abacus.util.u.Optional<T> |
get(Class<T> targetClass,
String objectId) |
<T> com.landawn.abacus.util.u.Optional<T> |
get(Class<T> targetClass,
String objectId,
Collection<String> selectPropNames) |
com.landawn.abacus.util.u.Optional<org.bson.Document> |
get(org.bson.types.ObjectId objectId) |
com.landawn.abacus.util.u.Optional<org.bson.Document> |
get(String objectId) |
<T> T |
gett(Class<T> targetClass,
org.bson.types.ObjectId objectId)
Gets the t.
|
<T> T |
gett(Class<T> targetClass,
org.bson.types.ObjectId objectId,
Collection<String> selectPropNames)
Gets the t.
|
<T> T |
gett(Class<T> targetClass,
String objectId)
Gets the t.
|
<T> T |
gett(Class<T> targetClass,
String objectId,
Collection<String> selectPropNames)
Gets the t.
|
org.bson.Document |
gett(org.bson.types.ObjectId objectId)
Gets the t.
|
org.bson.Document |
gett(String objectId)
Gets the t.
|
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
groupBy(Collection<String> fieldNames) |
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
groupBy(String fieldName) |
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
groupByAndCount(Collection<String> fieldNames)
Group by and count.
|
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
groupByAndCount(String fieldName)
Group by and count.
|
void |
insert(Object obj) |
void |
insert(Object obj,
com.mongodb.client.model.InsertOneOptions options) |
void |
insertAll(Collection<?> objList) |
void |
insertAll(Collection<?> objList,
com.mongodb.client.model.InsertManyOptions options) |
List<org.bson.Document> |
list(org.bson.conversions.Bson filter) |
<T> List<T> |
list(Class<T> targetClass,
org.bson.conversions.Bson filter) |
<T> List<T> |
list(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection) |
<T> List<T> |
list(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection,
int offset,
int count) |
<T> List<T> |
list(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter) |
<T> List<T> |
list(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort) |
<T> List<T> |
list(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
int offset,
int count) |
<T> List<T> |
list(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
int offset,
int count) |
<T> com.landawn.abacus.util.stream.Stream<T> |
mapReduce(Class<T> targetClass,
String mapFunction,
String reduceFunction) |
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
mapReduce(String mapFunction,
String reduceFunction) |
com.landawn.abacus.DataSet |
query(org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection,
int offset,
int count) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
int offset,
int count) |
<T> com.landawn.abacus.DataSet |
query(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
int offset,
int count) |
com.landawn.abacus.util.u.OptionalBoolean |
queryForBoolean(String propName,
org.bson.conversions.Bson filter)
Query for boolean.
|
com.landawn.abacus.util.u.OptionalByte |
queryForByte(String propName,
org.bson.conversions.Bson filter)
Query for byte.
|
com.landawn.abacus.util.u.OptionalChar |
queryForChar(String propName,
org.bson.conversions.Bson filter)
Query for char.
|
<T extends Date> |
queryForDate(Class<T> targetClass,
String propName,
org.bson.conversions.Bson filter)
Query for date.
|
com.landawn.abacus.util.u.Nullable<Date> |
queryForDate(String propName,
org.bson.conversions.Bson filter)
Query for date.
|
com.landawn.abacus.util.u.OptionalDouble |
queryForDouble(String propName,
org.bson.conversions.Bson filter)
Query for double.
|
com.landawn.abacus.util.u.OptionalFloat |
queryForFloat(String propName,
org.bson.conversions.Bson filter)
Query for float.
|
com.landawn.abacus.util.u.OptionalInt |
queryForInt(String propName,
org.bson.conversions.Bson filter)
Query for int.
|
com.landawn.abacus.util.u.OptionalLong |
queryForLong(String propName,
org.bson.conversions.Bson filter)
Query for long.
|
com.landawn.abacus.util.u.OptionalShort |
queryForShort(String propName,
org.bson.conversions.Bson filter)
Query for short.
|
<V> com.landawn.abacus.util.u.Optional<V> |
queryForSingleNonNull(Class<V> targetClass,
String propName,
org.bson.conversions.Bson filter) |
<V> com.landawn.abacus.util.u.Nullable<V> |
queryForSingleResult(Class<V> targetClass,
String propName,
org.bson.conversions.Bson filter)
Query for single result.
|
com.landawn.abacus.util.u.Nullable<String> |
queryForString(String propName,
org.bson.conversions.Bson filter)
Query for string.
|
com.mongodb.client.result.UpdateResult |
replace(org.bson.types.ObjectId objectId,
Object replacement) |
com.mongodb.client.result.UpdateResult |
replace(String objectId,
Object replacement) |
com.mongodb.client.result.UpdateResult |
replaceOne(org.bson.conversions.Bson filter,
Object replacement) |
com.mongodb.client.result.UpdateResult |
replaceOne(org.bson.conversions.Bson filter,
Object replacement,
com.mongodb.client.model.ReplaceOptions options) |
com.landawn.abacus.util.stream.Stream<org.bson.Document> |
stream(org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection,
int offset,
int count) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
int offset,
int count) |
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
int offset,
int count) |
com.mongodb.client.result.UpdateResult |
update(org.bson.types.ObjectId objectId,
Object update)
Update the record in data store with the properties which have been updated/set in the specified
update by the specified objectId . |
com.mongodb.client.result.UpdateResult |
update(String objectId,
Object update)
Update the record in data store with the properties which have been updated/set in the specified
update by the specified objectId . |
com.mongodb.client.result.UpdateResult |
updateAll(org.bson.conversions.Bson filter,
Object update)
Update the records in data store with the properties which have been updated/set in the specified
update by the specified filter . |
com.mongodb.client.result.UpdateResult |
updateAll(org.bson.conversions.Bson filter,
Object update,
com.mongodb.client.model.UpdateOptions options)
Update the records in data store with the properties which have been updated/set in the specified
update by the specified filter . |
com.mongodb.client.result.UpdateResult |
updateOne(org.bson.conversions.Bson filter,
Object update)
Just update one record in data store with the properties which have been updated/set in the specified
update by the specified filter . |
com.mongodb.client.result.UpdateResult |
updateOne(org.bson.conversions.Bson filter,
Object update,
com.mongodb.client.model.UpdateOptions options)
Just update one record in data store with the properties which have been updated/set in the specified
update by the specified filter . |
public com.mongodb.client.MongoCollection<org.bson.Document> coll()
public AsyncMongoCollectionExecutor async()
public boolean exists(String objectId)
objectId
- public boolean exists(org.bson.types.ObjectId objectId)
objectId
- public boolean exists(org.bson.conversions.Bson filter)
filter
- public long count()
public long count(org.bson.conversions.Bson filter)
filter
- public long count(org.bson.conversions.Bson filter, com.mongodb.client.model.CountOptions options)
filter
- options
- public com.landawn.abacus.util.u.Optional<org.bson.Document> get(String objectId)
objectId
- public com.landawn.abacus.util.u.Optional<org.bson.Document> get(org.bson.types.ObjectId objectId)
objectId
- public <T> com.landawn.abacus.util.u.Optional<T> get(Class<T> targetClass, String objectId)
T
- targetClass
- objectId
- public <T> com.landawn.abacus.util.u.Optional<T> get(Class<T> targetClass, org.bson.types.ObjectId objectId)
T
- targetClass
- objectId
- public <T> com.landawn.abacus.util.u.Optional<T> get(Class<T> targetClass, String objectId, Collection<String> selectPropNames)
T
- targetClass
- objectId
- selectPropNames
- public <T> com.landawn.abacus.util.u.Optional<T> get(Class<T> targetClass, org.bson.types.ObjectId objectId, Collection<String> selectPropNames)
T
- targetClass
- objectId
- selectPropNames
- public org.bson.Document gett(String objectId)
objectId
- public org.bson.Document gett(org.bson.types.ObjectId objectId)
objectId
- public <T> T gett(Class<T> targetClass, String objectId)
T
- targetClass
- objectId
- public <T> T gett(Class<T> targetClass, org.bson.types.ObjectId objectId)
T
- targetClass
- objectId
- public <T> T gett(Class<T> targetClass, String objectId, Collection<String> selectPropNames)
T
- targetClass
- objectId
- selectPropNames
- public <T> T gett(Class<T> targetClass, org.bson.types.ObjectId objectId, Collection<String> selectPropNames)
T
- targetClass
- objectId
- selectPropNames
- public com.landawn.abacus.util.u.Optional<org.bson.Document> findFirst(org.bson.conversions.Bson filter)
filter
- public <T> com.landawn.abacus.util.u.Optional<T> findFirst(Class<T> targetClass, org.bson.conversions.Bson filter)
T
- targetClass
- filter
- public <T> com.landawn.abacus.util.u.Optional<T> findFirst(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter)
T
- targetClass
- selectPropNames
- filter
- public <T> com.landawn.abacus.util.u.Optional<T> findFirst(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
T
- targetClass
- selectPropNames
- filter
- sort
- public <T> com.landawn.abacus.util.u.Optional<T> findFirst(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
T
- targetClass
- filter
- sort
- projection
- public List<org.bson.Document> list(org.bson.conversions.Bson filter)
filter
- public <T> List<T> list(Class<T> targetClass, org.bson.conversions.Bson filter)
T
- targetClass
- filter
- public <T> List<T> list(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter)
T
- targetClass
- selectPropNames
- filter
- public <T> List<T> list(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, int offset, int count)
T
- targetClass
- selectPropNames
- filter
- offset
- count
- public <T> List<T> list(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
T
- targetClass
- selectPropNames
- filter
- sort
- public <T> List<T> list(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, int offset, int count)
T
- targetClass
- an entity class with getter/setter method, Map.class
or basic single value type(Primitive/String/Date...)selectPropNames
- filter
- sort
- offset
- count
- public <T> List<T> list(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
T
- targetClass
- filter
- sort
- projection
- public <T> List<T> list(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection, int offset, int count)
T
- targetClass
- an entity class with getter/setter method, Map.class
or basic single value type(Primitive/String/Date...)filter
- sort
- projection
- offset
- count
- @Beta public com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalChar queryForChar(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalByte queryForByte(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalShort queryForShort(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalInt queryForInt(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalLong queryForLong(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalFloat queryForFloat(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.OptionalDouble queryForDouble(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.Nullable<String> queryForString(String propName, org.bson.conversions.Bson filter)
propName
- filter
- @Beta public com.landawn.abacus.util.u.Nullable<Date> queryForDate(String propName, org.bson.conversions.Bson filter)
propName
- filter
- public <T extends Date> com.landawn.abacus.util.u.Nullable<T> queryForDate(Class<T> targetClass, String propName, org.bson.conversions.Bson filter)
T
- targetClass
- propName
- filter
- public <V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<V> targetClass, String propName, org.bson.conversions.Bson filter)
V
- the value typetargetClass
- propName
- filter
- public <V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(Class<V> targetClass, String propName, org.bson.conversions.Bson filter)
V
- targetClass
- propName
- filter
- public com.landawn.abacus.DataSet query(org.bson.conversions.Bson filter)
filter
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, org.bson.conversions.Bson filter)
T
- targetClass
- filter
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter)
T
- targetClass
- selectPropNames
- filter
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, int offset, int count)
T
- targetClass
- selectPropNames
- filter
- offset
- count
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
T
- targetClass
- selectPropNames
- filter
- sort
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, int offset, int count)
T
- targetClass
- selectPropNames
- filter
- sort
- offset
- count
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
T
- targetClass
- filter
- sort
- projection
- public <T> com.landawn.abacus.DataSet query(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection, int offset, int count)
T
- targetClass
- filter
- sort
- projection
- offset
- count
- public com.landawn.abacus.util.stream.Stream<org.bson.Document> stream(org.bson.conversions.Bson filter)
filter
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, org.bson.conversions.Bson filter)
T
- targetClass
- filter
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter)
T
- targetClass
- selectPropNames
- filter
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, int offset, int count)
T
- targetClass
- selectPropNames
- filter
- offset
- count
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
T
- targetClass
- selectPropNames
- filter
- sort
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, int offset, int count)
T
- targetClass
- selectPropNames
- filter
- sort
- offset
- count
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
T
- targetClass
- filter
- sort
- projection
- public <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection, int offset, int count)
T
- targetClass
- filter
- sort
- projection
- offset
- count
- public void insert(Object obj)
obj
- can be Document/Map/entity
class with getter/setter method.public void insert(Object obj, com.mongodb.client.model.InsertOneOptions options)
obj
- options
- public void insertAll(Collection<?> objList)
objList
- list of Document/Map/entity
class with getter/setter method.public void insertAll(Collection<?> objList, com.mongodb.client.model.InsertManyOptions options)
objList
- list of Document/Map/entity
class with getter/setter method.options
- public com.mongodb.client.result.UpdateResult update(String objectId, Object update)
update
by the specified objectId
.
if the update
implements DirtyMarker
interface, just update the dirty properties.objectId
- update
- can be Bson/Document/Map/entity class with getter/setter method.
public com.mongodb.client.result.UpdateResult update(org.bson.types.ObjectId objectId, Object update)
update
by the specified objectId
.
if the update
implements DirtyMarker
interface, just update the dirty properties.objectId
- update
- can be Bson/Document/Map/entity class with getter/setter method.
public com.mongodb.client.result.UpdateResult updateOne(org.bson.conversions.Bson filter, Object update)
update
by the specified filter
.
if the update
implements DirtyMarker
interface, just update the dirty properties.filter
- update
- can be Bson/Document/Map/entity class with getter/setter method.
public com.mongodb.client.result.UpdateResult updateOne(org.bson.conversions.Bson filter, Object update, com.mongodb.client.model.UpdateOptions options)
update
by the specified filter
.
if the update
implements DirtyMarker
interface, just update the dirty properties.filter
- update
- can be Bson/Document/Map/entity class with getter/setter method.
options
- public com.mongodb.client.result.UpdateResult updateAll(org.bson.conversions.Bson filter, Object update)
update
by the specified filter
.
if the update
implements DirtyMarker
interface, just update the dirty properties.filter
- update
- can be Bson/Document/Map/entity class with getter/setter method.
public com.mongodb.client.result.UpdateResult updateAll(org.bson.conversions.Bson filter, Object update, com.mongodb.client.model.UpdateOptions options)
update
by the specified filter
.
if the update
implements DirtyMarker
interface, just update the dirty properties.filter
- update
- can be Bson/Document/Map/entity class with getter/setter method.
options
- public com.mongodb.client.result.UpdateResult replace(String objectId, Object replacement)
objectId
- replacement
- can be Document/Map/entity
class with getter/setter method.public com.mongodb.client.result.UpdateResult replace(org.bson.types.ObjectId objectId, Object replacement)
objectId
- replacement
- can be Document/Map/entity
class with getter/setter method.public com.mongodb.client.result.UpdateResult replaceOne(org.bson.conversions.Bson filter, Object replacement)
filter
- replacement
- can be Document/Map/entity
class with getter/setter method.public com.mongodb.client.result.UpdateResult replaceOne(org.bson.conversions.Bson filter, Object replacement, com.mongodb.client.model.ReplaceOptions options)
filter
- replacement
- can be Document/Map/entity
class with getter/setter method.options
- public com.mongodb.client.result.DeleteResult delete(String objectId)
objectId
- public com.mongodb.client.result.DeleteResult delete(org.bson.types.ObjectId objectId)
objectId
- public com.mongodb.client.result.DeleteResult deleteOne(org.bson.conversions.Bson filter)
filter
- public com.mongodb.client.result.DeleteResult deleteOne(org.bson.conversions.Bson filter, com.mongodb.client.model.DeleteOptions options)
filter
- options
- public com.mongodb.client.result.DeleteResult deleteAll(org.bson.conversions.Bson filter)
filter
- public com.mongodb.client.result.DeleteResult deleteAll(org.bson.conversions.Bson filter, com.mongodb.client.model.DeleteOptions options)
filter
- options
- public int bulkInsert(Collection<?> entities)
entities
- public int bulkInsert(Collection<?> entities, com.mongodb.client.model.BulkWriteOptions options)
entities
- options
- public com.mongodb.bulk.BulkWriteResult bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests)
requests
- public com.mongodb.bulk.BulkWriteResult bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests, com.mongodb.client.model.BulkWriteOptions options)
requests
- options
- public <T> com.landawn.abacus.util.stream.Stream<T> distinct(Class<T> targetClass, String fieldName)
T
- targetClass
- fieldName
- public <T> com.landawn.abacus.util.stream.Stream<T> distinct(Class<T> targetClass, String fieldName, org.bson.conversions.Bson filter)
T
- targetClass
- fieldName
- filter
- public com.landawn.abacus.util.stream.Stream<org.bson.Document> aggregate(List<? extends org.bson.conversions.Bson> pipeline)
pipeline
- public <T> com.landawn.abacus.util.stream.Stream<T> aggregate(Class<T> targetClass, List<? extends org.bson.conversions.Bson> pipeline)
T
- targetClass
- pipeline
- public com.landawn.abacus.util.stream.Stream<org.bson.Document> mapReduce(String mapFunction, String reduceFunction)
mapFunction
- reduceFunction
- public <T> com.landawn.abacus.util.stream.Stream<T> mapReduce(Class<T> targetClass, String mapFunction, String reduceFunction)
T
- targetClass
- mapFunction
- reduceFunction
- @Beta public com.landawn.abacus.util.stream.Stream<org.bson.Document> groupBy(String fieldName)
fieldName
- @Beta public com.landawn.abacus.util.stream.Stream<org.bson.Document> groupBy(Collection<String> fieldNames)
fieldNames
- @Beta public com.landawn.abacus.util.stream.Stream<org.bson.Document> groupByAndCount(String fieldName)
fieldName
- @Beta public com.landawn.abacus.util.stream.Stream<org.bson.Document> groupByAndCount(Collection<String> fieldNames)
fieldNames
- Copyright © 2021. All rights reserved.