构建MongoCollection.updateOne(Bson filter, Bson update)参数

Bson filter = Filters.eq("_id", id);
Bson update =  new Document("$set",
                  new Document()
                        .append("lastIndex", lastIndexValue)
                        .append("created", new Date()));
MongoCollection.updateOne(filter, update);
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页