Java Mongo 查询错误

来源:互联网 发布:淘宝联盟用红包有返利 编辑:程序博客网 时间:2024/06/06 18:07

com.his.mongodb.exception.SystemMongoDBException: com.mongodb.MongoQueryException: Query failed with error code 2 and error message ‘bad sort specification’ on server

解决:
Document sort = new Document(“_id”, “-1”);
改为:
Document sort = new Document(“_id”, -1);

原创粉丝点击