但是我不知道在那里面用啊!这是我写的代码,是在这里面去除重复吗?
public List getJsonObjects(String spaceStr , String collectionStr, BSONObject matcher,BSONObject orderBy,long skipRows, long returnRows){
List result = new ArrayList();
if (sdb.isCollectionSpaceExist(spaceStr)) {
CollectionSpace db = sdb.getCollectionSpace(spaceStr);
if (db.isCollectionExist(collectionStr)) {
DBCollection DBCollection = db.getCollection(collectionStr);
DBCollection.aggregate(obj);
ArrayList objects = this.getRecoders(DBCollection,matcher,orderBy,false, skipRows, returnRows);
for (BSONObject object : objects) {
result.add(object.toString());
}
}
}
return result;
}