0

MongoDB Java ドライバーを使用して、サブフィールドで GroupCommand を実行できるかどうかを知りたいです。3番目のパラメータでどのように表現できるかわかりません。

MongoDB.use(DefaultMongoIdentifier) { db =>
      var collection = db.getCollection(collectionName)
      var cmd = new GroupCommand(collection,
        null,
        new BasicDBObject("items", new BasicDBObject("field", 1)),
        new BasicDBObject("count", 0),
        "function ( curr, result ) {result.count++}",
        null);
      implicit val formats = net.liftweb.json.DefaultFormats
      println(JObjectParser.serialize(collection.group(cmd)).extract[List[Map[String, String]]])
      JObjectParser.serialize(collection.group(cmd)).extract[List[Map[String, String]]]
    }
4

0 に答える 0