Skip to content

Commit

Permalink
Merge pull request #10 from T-baby/dev
Browse files Browse the repository at this point in the history
返回的结果中id的key不再是_id而是id
  • Loading branch information
T-baby authored Aug 12, 2016
2 parents 4095664 + 7242d3f commit 262c172
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/cybermkd/kit/MongoKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static List<JSONObject> find(String collectionName, Bson query, Bson proj
Block<Document> block = new Block<Document>() {

public void apply(final Document document) {
document.put("_id", document.get("_id").toString());
document.put("id", document.get("_id").toString());
list.add(JSONObject.parseObject(document.toJson()));
}
};
Expand All @@ -108,7 +108,7 @@ public static <T> List find(String collectionName, Bson query, Bson projection,
Block<Document> block = new Block<Document>() {

public void apply(final Document document) {
document.put("_id", document.get("_id").toString());
document.put("id", document.get("_id").toString());
list.add(JSON.parseObject(document.toJson(),clazz));
}
};
Expand Down

0 comments on commit 262c172

Please sign in to comment.