dew 发表于 2017-12-15 11:16:56

MongoDB Java Driver 3.4操作

Document document2 = new Document("name", "lebo")  .append("age", 24)
  .append("type", 1)
  .append("status", "A")
  .append("favorites", new Document("sports", "run").append("food", "photo"));
  List<Document> documents = new ArrayList<>();
  documents.add(document);
  documents.add(document2);
  collection.insertMany(documents); // 插入多条数据
页: [1]
查看完整版本: MongoDB Java Driver 3.4操作