public class MongoCollectionsKt
@NotNull
public static <T> org.reactivestreams.Publisher<java.lang.Long> countDocuments(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$countDocuments,
@NotNull
java.lang.String filter)
Counts the number of documents in the collection according to the given options.
filter - the query filter@NotNull
public static <T> org.reactivestreams.Publisher<java.lang.Long> countDocuments(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$countDocuments,
@NotNull
java.lang.String filter,
@NotNull
com.mongodb.client.model.CountOptions options)
Counts the number of documents in the collection according to the given options.
filter - the query filter@NotNull
public static <T> com.mongodb.reactivestreams.client.FindPublisher<T> find(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$find,
@NotNull
java.lang.String filter)
Finds all documents that match the filter in the collection.
filter - the query filter@NotNull
public static <T> com.mongodb.reactivestreams.client.FindPublisher<T> find(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$find,
@NotNull
org.bson.conversions.Bson... filters)
Finds all documents in the collection.
filters - the query filters@NotNull
public static <T> org.reactivestreams.Publisher<T> findOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOne,
@NotNull
java.lang.String filter)
Finds the first document that match the filter in the collection.
filter - the query filter@NotNull
public static <T> org.reactivestreams.Publisher<T> findOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOne,
@NotNull
org.bson.conversions.Bson filter)
Finds the first document that match the filter in the collection.
filter - the query filter@NotNull
public static <T> org.reactivestreams.Publisher<T> findOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOne,
@NotNull
org.bson.conversions.Bson... filters)
Finds the first document that match the filters in the collection.
filters - the query filters@NotNull
public static <T> org.reactivestreams.Publisher<T> findOneById(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOneById,
@NotNull
java.lang.Object id)
Finds the document that match the id parameter.
id - the object id@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.DeleteResult> deleteOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$deleteOne,
@NotNull
java.lang.String filter)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
filter - the query filter to apply the the delete operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.DeleteResult> deleteOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$deleteOne,
@NotNull
org.bson.conversions.Bson... filters)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
filters - the query filters to apply the the delete operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.DeleteResult> deleteOneById(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$deleteOneById,
@NotNull
java.lang.Object id)
Removes at most one document from the id parameter. If no documents match, the collection is not modified.
id - the object id@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.DeleteResult> deleteMany(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$deleteMany,
@NotNull
java.lang.String filter,
@NotNull
com.mongodb.client.model.DeleteOptions options)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
filter - the query filter to apply the the delete operationoptions - the options to apply to the delete operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.DeleteResult> deleteMany(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$deleteMany,
@NotNull
org.bson.conversions.Bson[] filters,
@NotNull
com.mongodb.client.model.DeleteOptions options)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
options - the options to apply to the delete operation@NotNull
public static <T> org.reactivestreams.Publisher<?> save(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$save,
@NotNull
T document)
Save the document.
If the document has no id field, or if the document has a null id value, insert the document.
Otherwise, call replaceOneById with upsert true.
document - the document to savereplaceOneById@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> replaceOneById(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$replaceOneById,
@NotNull
java.lang.Object id,
@NotNull
T replacement)
Replace a document in the collection according to the specified arguments.
id - the object idreplacement - the replacement document@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> replaceOneById(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$replaceOneById,
@NotNull
java.lang.Object id,
@NotNull
T replacement,
@NotNull
com.mongodb.client.model.ReplaceOptions options)
Replace a document in the collection according to the specified arguments.
id - the object idreplacement - the replacement documentoptions - the options to apply to the replace operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> replaceOneWithoutId(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$replaceOneWithoutId,
@NotNull
java.lang.String filter,
@NotNull
T replacement,
@NotNull
com.mongodb.client.model.ReplaceOptions options)
Replace a document in the collection according to the specified arguments. The id of the provided document is not used, in order to avoid updated id error. You may have to use UpdateResult.getUpsertedId in order to retrieve the generated id.
filter - the query filter to apply to the replace operationreplacement - the replacement documentoptions - the options to apply to the replace operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> replaceOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$replaceOne,
@NotNull
java.lang.String filter,
@NotNull
T replacement,
@NotNull
com.mongodb.client.model.ReplaceOptions options)
Replace a document in the collection according to the specified arguments.
filter - the query filter to apply to the replace operationreplacement - the replacement documentoptions - the options to apply to the replace operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> updateOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$updateOne,
@NotNull
java.lang.String filter,
@NotNull
java.lang.String update,
@NotNull
com.mongodb.client.model.UpdateOptions options)
Update a single document in the collection according to the specified arguments.
filter - a document describing the query filterupdate - a document describing the update. The update to apply must include only update operators.options - the options to apply to the update operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> updateOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$updateOne,
@NotNull
java.lang.String filter,
@NotNull
java.lang.Object update,
@NotNull
com.mongodb.client.model.UpdateOptions options,
boolean updateOnlyNotNullProperties)
Update a single document in the collection according to the specified arguments.
filter - a document describing the query filterupdate - the update objectoptions - the options to apply to the update operationupdateOnlyNotNullProperties - if true do not change null properties@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> updateOne(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$updateOne,
@NotNull
org.bson.conversions.Bson filter,
@NotNull
java.lang.Object target,
@NotNull
com.mongodb.client.model.UpdateOptions options)
Update a single document in the collection according to the specified arguments.
filter - a document describing the query filteroptions - the options to apply to the update operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> updateOneById(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$updateOneById,
@NotNull
java.lang.Object id,
@NotNull
java.lang.Object update,
@NotNull
com.mongodb.client.model.UpdateOptions options)
Update a single document in the collection according to the specified arguments.
id - the object idupdate - the update objectoptions - the options to apply to the update operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> updateMany(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$updateMany,
@NotNull
java.lang.String filter,
@NotNull
java.lang.String update,
@NotNull
com.mongodb.client.model.UpdateOptions updateOptions)
Update all documents in the collection according to the specified arguments.
filter - a document describing the query filterupdate - a document describing the update. The update to apply must include only update operators.updateOptions - the options to apply to the update operation@NotNull
public static <T> org.reactivestreams.Publisher<com.mongodb.client.result.UpdateResult> updateMany(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$updateMany,
@NotNull
org.bson.conversions.Bson filter,
@NotNull
org.litote.kmongo.SetTo[] updates,
@NotNull
com.mongodb.client.model.UpdateOptions updateOptions)
Update all documents in the collection according to the specified arguments.
filter - a document describing the query filter, which may not be null.updates - a document describing the update, which may not be null. The update to apply must include only update operators.updateOptions - the options to apply to the update operation@NotNull
public static <T> org.reactivestreams.Publisher<T> findOneAndDelete(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOneAndDelete,
@NotNull
java.lang.String filter,
@NotNull
com.mongodb.client.model.FindOneAndDeleteOptions options)
Atomically find a document and remove it.
filter - the query filter to find the document withoptions - the options to apply to the operation@NotNull
public static <T> org.reactivestreams.Publisher<T> findOneAndReplace(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOneAndReplace,
@NotNull
java.lang.String filter,
T replacement,
@NotNull
com.mongodb.client.model.FindOneAndReplaceOptions options)
Atomically find a document and replace it.
filter - the query filter to apply the the replace operationreplacement - the replacement documentoptions - the options to apply to the operation@NotNull
public static <T> org.reactivestreams.Publisher<T> findOneAndUpdate(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$findOneAndUpdate,
@NotNull
java.lang.String filter,
@NotNull
java.lang.String update,
@NotNull
com.mongodb.client.model.FindOneAndUpdateOptions options)
Atomically find a document and update it.
filter - a document describing the query filterupdate - a document describing the update. The update to apply must include only update operators.options - the options to apply to the operation@NotNull
public static <T> org.reactivestreams.Publisher<java.lang.String> createIndex(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$createIndex,
@NotNull
java.lang.String key)
Creates an index.
key - an object describing the index key(s)@NotNull
public static <T> org.reactivestreams.Publisher<java.lang.String> createIndex(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$createIndex,
@NotNull
java.lang.String key,
@NotNull
com.mongodb.client.model.IndexOptions options)
Creates an index.
key - an object describing the index key(s)options - the options for the index@NotNull
public static <T> org.reactivestreams.Publisher<java.lang.Void> dropIndexOfKeys(@NotNull
com.mongodb.reactivestreams.client.MongoCollection<T> $this$dropIndexOfKeys,
@NotNull
java.lang.String keys)
Drops the index given the keys used to create it.
keys - the keys of the index to remove