br.com.anteros.nosql.persistence.mongodb.session.MongoMappedDocument Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-NoSql-Persistence-MongoDB Show documentation
Show all versions of Anteros-NoSql-Persistence-MongoDB Show documentation
Anteros NoSQL Persistence MongoDB.
package br.com.anteros.nosql.persistence.mongodb.session;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.bson.Document;
import org.bson.conversions.Bson;
import com.mongodb.client.model.Filters;
import br.com.anteros.nosql.persistence.mongodb.query.MongoUpdate;
import br.com.anteros.nosql.persistence.session.NoSQLMappedDocument;
import br.com.anteros.nosql.persistence.session.query.NoSQLUpdate;
public class MongoMappedDocument implements NoSQLMappedDocument {
private static final String ID_FIELD = "_id";
private static final Document ID_ONLY_PROJECTION = new Document(ID_FIELD, 1);
private Document document;
private MongoMappedDocument(Document document) {
this.document = document;
}
public static MongoMappedDocument of(Document document) {
return new MongoMappedDocument(document);
}
public static Document getIdOnlyProjection() {
return ID_ONLY_PROJECTION;
}
public static Document getIdIn(Collection> ids) {
return new Document(ID_FIELD, new Document("$in", ids));
}
public static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy