T
- the generic typepublic final class MongoCollectionMapper<T> extends Object
Modifier and Type | Method and Description |
---|---|
com.landawn.abacus.util.stream.Stream<T> |
aggregate(List<? extends org.bson.conversions.Bson> pipeline)
Aggregate.
|
int |
bulkInsert(Collection<? extends T> entities)
Bulk insert.
|
int |
bulkInsert(Collection<? extends T> entities,
com.mongodb.client.model.BulkWriteOptions options)
Bulk insert.
|
com.mongodb.bulk.BulkWriteResult |
bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests)
Bulk write.
|
com.mongodb.bulk.BulkWriteResult |
bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests,
com.mongodb.client.model.BulkWriteOptions options)
Bulk write.
|
MongoCollectionExecutor |
collExecutor()
Coll executor.
|
long |
count()
Count.
|
long |
count(org.bson.conversions.Bson filter)
Count.
|
long |
count(org.bson.conversions.Bson filter,
com.mongodb.client.model.CountOptions options)
Count.
|
com.mongodb.client.result.DeleteResult |
delete(org.bson.types.ObjectId objectId)
Delete.
|
com.mongodb.client.result.DeleteResult |
delete(String objectId)
Delete.
|
com.mongodb.client.result.DeleteResult |
deleteAll(org.bson.conversions.Bson filter)
Delete all.
|
com.mongodb.client.result.DeleteResult |
deleteAll(org.bson.conversions.Bson filter,
com.mongodb.client.model.DeleteOptions options)
Delete all.
|
com.mongodb.client.result.DeleteResult |
deleteOne(org.bson.conversions.Bson filter)
Delete one.
|
com.mongodb.client.result.DeleteResult |
deleteOne(org.bson.conversions.Bson filter,
com.mongodb.client.model.DeleteOptions options)
Delete one.
|
com.landawn.abacus.util.stream.Stream<T> |
distinct(String fieldName)
Distinct.
|
com.landawn.abacus.util.stream.Stream<T> |
distinct(String fieldName,
org.bson.conversions.Bson filter)
Distinct.
|
boolean |
exists(org.bson.conversions.Bson filter)
Exists.
|
boolean |
exists(org.bson.types.ObjectId objectId)
Exists.
|
boolean |
exists(String objectId)
Exists.
|
com.landawn.abacus.util.u.Optional<T> |
findFirst(org.bson.conversions.Bson filter)
Find first.
|
com.landawn.abacus.util.u.Optional<T> |
findFirst(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection)
Find first.
|
com.landawn.abacus.util.u.Optional<T> |
findFirst(Collection<String> selectPropNames,
org.bson.conversions.Bson filter)
Find first.
|
com.landawn.abacus.util.u.Optional<T> |
findFirst(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort)
Find first.
|
com.landawn.abacus.util.u.Optional<T> |
get(org.bson.types.ObjectId objectId)
Gets the.
|
com.landawn.abacus.util.u.Optional<T> |
get(org.bson.types.ObjectId objectId,
Collection<String> selectPropNames)
Gets the.
|
com.landawn.abacus.util.u.Optional<T> |
get(String objectId)
Gets the.
|
com.landawn.abacus.util.u.Optional<T> |
get(String objectId,
Collection<String> selectPropNames)
Gets the.
|
T |
gett(org.bson.types.ObjectId objectId)
Gets the t.
|
T |
gett(org.bson.types.ObjectId objectId,
Collection<String> selectPropNames)
Gets the t.
|
T |
gett(String objectId)
Gets the t.
|
T |
gett(String objectId,
Collection<String> selectPropNames)
Gets the t.
|
void |
insert(T obj)
Insert.
|
void |
insert(T obj,
com.mongodb.client.model.InsertOneOptions options)
Insert.
|
void |
insertAll(Collection<? extends T> objList)
Insert all.
|
void |
insertAll(Collection<? extends T> objList,
com.mongodb.client.model.InsertManyOptions options)
Insert all.
|
List<T> |
list(org.bson.conversions.Bson filter)
List.
|
List<T> |
list(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection)
List.
|
List<T> |
list(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection,
int offset,
int count)
List.
|
List<T> |
list(Collection<String> selectPropNames,
org.bson.conversions.Bson filter)
List.
|
List<T> |
list(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort)
List.
|
List<T> |
list(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
int offset,
int count)
List.
|
List<T> |
list(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
int offset,
int count)
List.
|
com.landawn.abacus.util.stream.Stream<T> |
mapReduce(String mapFunction,
String reduceFunction)
Map reduce.
|
com.landawn.abacus.DataSet |
query(org.bson.conversions.Bson filter)
Query.
|
com.landawn.abacus.DataSet |
query(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection)
Query.
|
com.landawn.abacus.DataSet |
query(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection,
int offset,
int count)
Query.
|
com.landawn.abacus.DataSet |
query(Collection<String> selectPropNames,
org.bson.conversions.Bson filter)
Query.
|
com.landawn.abacus.DataSet |
query(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort)
Query.
|
com.landawn.abacus.DataSet |
query(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
int offset,
int count)
Query.
|
com.landawn.abacus.DataSet |
query(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
int offset,
int count)
Query.
|
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.
|
<P extends Date> |
queryForDate(Class<P> targetPropClass,
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.Nullable<V> |
queryForSingleResult(Class<V> targetPropClass,
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,
T replacement)
Replace.
|
com.mongodb.client.result.UpdateResult |
replace(String objectId,
T replacement)
Replace.
|
com.mongodb.client.result.UpdateResult |
replaceOne(org.bson.conversions.Bson filter,
T replacement)
Replace one.
|
com.mongodb.client.result.UpdateResult |
replaceOne(org.bson.conversions.Bson filter,
T replacement,
com.mongodb.client.model.ReplaceOptions options)
Replace one.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(org.bson.conversions.Bson filter)
Stream.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection)
Stream.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
org.bson.conversions.Bson projection,
int offset,
int count)
Stream.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(Collection<String> selectPropNames,
org.bson.conversions.Bson filter)
Stream.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort)
Stream.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
org.bson.conversions.Bson sort,
int offset,
int count)
Stream.
|
com.landawn.abacus.util.stream.Stream<T> |
stream(Collection<String> selectPropNames,
org.bson.conversions.Bson filter,
int offset,
int count)
Stream.
|
com.mongodb.client.result.UpdateResult |
update(org.bson.types.ObjectId objectId,
T update)
Update.
|
com.mongodb.client.result.UpdateResult |
update(String objectId,
T update)
Update.
|
com.mongodb.client.result.UpdateResult |
updateAll(org.bson.conversions.Bson filter,
T update)
Update all.
|
com.mongodb.client.result.UpdateResult |
updateAll(org.bson.conversions.Bson filter,
T update,
com.mongodb.client.model.UpdateOptions options)
Update all.
|
com.mongodb.client.result.UpdateResult |
updateOne(org.bson.conversions.Bson filter,
T update)
Update one.
|
com.mongodb.client.result.UpdateResult |
updateOne(org.bson.conversions.Bson filter,
T update,
com.mongodb.client.model.UpdateOptions options)
Update one.
|
public MongoCollectionExecutor collExecutor()
public boolean exists(String objectId)
objectId
- the object idpublic boolean exists(org.bson.types.ObjectId objectId)
objectId
- the object idpublic boolean exists(org.bson.conversions.Bson filter)
filter
- the filterpublic long count()
public long count(org.bson.conversions.Bson filter)
filter
- the filterpublic long count(org.bson.conversions.Bson filter, com.mongodb.client.model.CountOptions options)
filter
- the filteroptions
- the optionspublic com.landawn.abacus.util.u.Optional<T> get(String objectId)
objectId
- the object idpublic com.landawn.abacus.util.u.Optional<T> get(org.bson.types.ObjectId objectId)
objectId
- the object idpublic com.landawn.abacus.util.u.Optional<T> get(String objectId, Collection<String> selectPropNames)
objectId
- the object idselectPropNames
- the select prop namespublic com.landawn.abacus.util.u.Optional<T> get(org.bson.types.ObjectId objectId, Collection<String> selectPropNames)
objectId
- the object idselectPropNames
- the select prop namespublic T gett(org.bson.types.ObjectId objectId)
objectId
- the object idpublic T gett(String objectId, Collection<String> selectPropNames)
objectId
- the object idselectPropNames
- the select prop namespublic T gett(org.bson.types.ObjectId objectId, Collection<String> selectPropNames)
objectId
- the object idselectPropNames
- the select prop namespublic com.landawn.abacus.util.u.Optional<T> findFirst(org.bson.conversions.Bson filter)
filter
- the filterpublic com.landawn.abacus.util.u.Optional<T> findFirst(Collection<String> selectPropNames, org.bson.conversions.Bson filter)
selectPropNames
- the select prop namesfilter
- the filterpublic com.landawn.abacus.util.u.Optional<T> findFirst(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortpublic com.landawn.abacus.util.u.Optional<T> findFirst(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
filter
- the filtersort
- the sortprojection
- the projectionpublic List<T> list(org.bson.conversions.Bson filter)
filter
- the filterpublic List<T> list(Collection<String> selectPropNames, org.bson.conversions.Bson filter)
selectPropNames
- the select prop namesfilter
- the filterpublic List<T> list(Collection<String> selectPropNames, org.bson.conversions.Bson filter, int offset, int count)
selectPropNames
- the select prop namesfilter
- the filteroffset
- the offsetcount
- the countpublic List<T> list(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortpublic List<T> list(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, int offset, int count)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortoffset
- the offsetcount
- the countpublic List<T> list(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
filter
- the filtersort
- the sortprojection
- the projectionpublic List<T> list(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection, int offset, int count)
filter
- the filtersort
- the sortprojection
- the projectionoffset
- the offsetcount
- the count@Beta public com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalChar queryForChar(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalByte queryForByte(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalShort queryForShort(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalInt queryForInt(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalLong queryForLong(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalFloat queryForFloat(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.OptionalDouble queryForDouble(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.Nullable<String> queryForString(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filter@Beta public com.landawn.abacus.util.u.Nullable<Date> queryForDate(String propName, org.bson.conversions.Bson filter)
propName
- the prop namefilter
- the filterpublic <P extends Date> com.landawn.abacus.util.u.Nullable<P> queryForDate(Class<P> targetPropClass, String propName, org.bson.conversions.Bson filter)
P
- the generic typetargetPropClass
- the target prop classpropName
- the prop namefilter
- the filterpublic <V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<V> targetPropClass, String propName, org.bson.conversions.Bson filter)
V
- the value typetargetPropClass
- the target prop classpropName
- the prop namefilter
- the filterpublic com.landawn.abacus.DataSet query(org.bson.conversions.Bson filter)
filter
- the filterpublic com.landawn.abacus.DataSet query(Collection<String> selectPropNames, org.bson.conversions.Bson filter)
selectPropNames
- the select prop namesfilter
- the filterpublic com.landawn.abacus.DataSet query(Collection<String> selectPropNames, org.bson.conversions.Bson filter, int offset, int count)
selectPropNames
- the select prop namesfilter
- the filteroffset
- the offsetcount
- the countpublic com.landawn.abacus.DataSet query(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortpublic com.landawn.abacus.DataSet query(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, int offset, int count)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortoffset
- the offsetcount
- the countpublic com.landawn.abacus.DataSet query(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
filter
- the filtersort
- the sortprojection
- the projectionpublic com.landawn.abacus.DataSet query(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection, int offset, int count)
filter
- the filtersort
- the sortprojection
- the projectionoffset
- the offsetcount
- the countpublic com.landawn.abacus.util.stream.Stream<T> stream(org.bson.conversions.Bson filter)
filter
- the filterpublic com.landawn.abacus.util.stream.Stream<T> stream(Collection<String> selectPropNames, org.bson.conversions.Bson filter)
selectPropNames
- the select prop namesfilter
- the filterpublic com.landawn.abacus.util.stream.Stream<T> stream(Collection<String> selectPropNames, org.bson.conversions.Bson filter, int offset, int count)
selectPropNames
- the select prop namesfilter
- the filteroffset
- the offsetcount
- the countpublic com.landawn.abacus.util.stream.Stream<T> stream(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortpublic com.landawn.abacus.util.stream.Stream<T> stream(Collection<String> selectPropNames, org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, int offset, int count)
selectPropNames
- the select prop namesfilter
- the filtersort
- the sortoffset
- the offsetcount
- the countpublic com.landawn.abacus.util.stream.Stream<T> stream(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection)
filter
- the filtersort
- the sortprojection
- the projectionpublic com.landawn.abacus.util.stream.Stream<T> stream(org.bson.conversions.Bson filter, org.bson.conversions.Bson sort, org.bson.conversions.Bson projection, int offset, int count)
filter
- the filtersort
- the sortprojection
- the projectionoffset
- the offsetcount
- the countpublic void insert(T obj)
obj
- the objpublic void insert(T obj, com.mongodb.client.model.InsertOneOptions options)
obj
- the objoptions
- the optionspublic void insertAll(Collection<? extends T> objList)
objList
- the obj listpublic void insertAll(Collection<? extends T> objList, com.mongodb.client.model.InsertManyOptions options)
objList
- the obj listoptions
- the optionspublic com.mongodb.client.result.UpdateResult update(String objectId, T update)
objectId
- the object idupdate
- the updatepublic com.mongodb.client.result.UpdateResult update(org.bson.types.ObjectId objectId, T update)
objectId
- the object idupdate
- the updatepublic com.mongodb.client.result.UpdateResult updateOne(org.bson.conversions.Bson filter, T update)
filter
- the filterupdate
- the updatepublic com.mongodb.client.result.UpdateResult updateOne(org.bson.conversions.Bson filter, T update, com.mongodb.client.model.UpdateOptions options)
filter
- the filterupdate
- the updateoptions
- the optionspublic com.mongodb.client.result.UpdateResult updateAll(org.bson.conversions.Bson filter, T update)
filter
- the filterupdate
- the updatepublic com.mongodb.client.result.UpdateResult updateAll(org.bson.conversions.Bson filter, T update, com.mongodb.client.model.UpdateOptions options)
filter
- the filterupdate
- the updateoptions
- the optionspublic com.mongodb.client.result.UpdateResult replace(String objectId, T replacement)
objectId
- the object idreplacement
- the replacementpublic com.mongodb.client.result.UpdateResult replace(org.bson.types.ObjectId objectId, T replacement)
objectId
- the object idreplacement
- the replacementpublic com.mongodb.client.result.UpdateResult replaceOne(org.bson.conversions.Bson filter, T replacement)
filter
- the filterreplacement
- the replacementpublic com.mongodb.client.result.UpdateResult replaceOne(org.bson.conversions.Bson filter, T replacement, com.mongodb.client.model.ReplaceOptions options)
filter
- the filterreplacement
- the replacementoptions
- the optionspublic com.mongodb.client.result.DeleteResult delete(String objectId)
objectId
- the object idpublic com.mongodb.client.result.DeleteResult delete(org.bson.types.ObjectId objectId)
objectId
- the object idpublic com.mongodb.client.result.DeleteResult deleteOne(org.bson.conversions.Bson filter)
filter
- the filterpublic com.mongodb.client.result.DeleteResult deleteOne(org.bson.conversions.Bson filter, com.mongodb.client.model.DeleteOptions options)
filter
- the filteroptions
- the optionspublic com.mongodb.client.result.DeleteResult deleteAll(org.bson.conversions.Bson filter)
filter
- the filterpublic com.mongodb.client.result.DeleteResult deleteAll(org.bson.conversions.Bson filter, com.mongodb.client.model.DeleteOptions options)
filter
- the filteroptions
- the optionspublic int bulkInsert(Collection<? extends T> entities)
entities
- the entitiespublic int bulkInsert(Collection<? extends T> entities, com.mongodb.client.model.BulkWriteOptions options)
entities
- the entitiesoptions
- the optionspublic com.mongodb.bulk.BulkWriteResult bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests)
requests
- the requestspublic com.mongodb.bulk.BulkWriteResult bulkWrite(List<? extends com.mongodb.client.model.WriteModel<? extends org.bson.Document>> requests, com.mongodb.client.model.BulkWriteOptions options)
requests
- the requestsoptions
- the optionspublic com.landawn.abacus.util.stream.Stream<T> distinct(String fieldName)
fieldName
- the field namepublic com.landawn.abacus.util.stream.Stream<T> distinct(String fieldName, org.bson.conversions.Bson filter)
fieldName
- the field namefilter
- the filterpublic com.landawn.abacus.util.stream.Stream<T> aggregate(List<? extends org.bson.conversions.Bson> pipeline)
pipeline
- the pipelineCopyright © 2019. All rights reserved.