Can';t使用Meteor 1.2.0.2将Mongodb从3.4版迁移到3.6版
我们需要将当前的Mongodb 3.4迁移到3.6版,但建议不起作用。 Mongo说您需要在聚合中发送游标选项,我这样做的方式是:someCollection.aggregate(管道,{cursor:{})。 我们的聚合在使用MongoDB3.4时运行良好,但在3.6中尝试运行它们时,它们不起作用。 该应用程序使用Meteor框架1.2.0.2版编写 与Mongodb相关的包有:Can';t使用Meteor 1.2.0.2将Mongodb从3.4版迁移到3.6版,mongodb,meteor,angular-meteor,Mongodb,Meteor,Angular Meteor,我们需要将当前的Mongodb 3.4迁移到3.6版,但建议不起作用。 Mongo说您需要在聚合中发送游标选项,我这样做的方式是:someCollection.aggregate(管道,{cursor:{})。 我们的聚合在使用MongoDB3.4时运行良好,但在3.6中尝试运行它们时,它们不起作用。 该应用程序使用Meteor框架1.2.0.2版编写 与Mongodb相关的包有: dburles:mongo集合-instances@0.3.4 minimongo@1.0.10 mongo@1.
let pipeline = [
{$match: {'contractor._id': contractorId, _id: {$ne: apptId}, start: {$lte: appt.start}}},
{$unwind: '$notes'},
{$sort: {start: -1, 'notes.creationDate': 1}}
];
以下是我尝试过的选项
#1:
#2:
#3:
#4:
#5:
#6:
//结果#1到#5:所有选项都会使应用程序挂起,它永远无法返回到返回语句,客户端永远无法解决承诺
//结果#6:它向前端返回一个没有数据的对象,它只有以下属性:_readableState、readable、domain、_events、_maxListeners。
在后端,它有以下方法:explain、get、getOne、each、next、close、\u read
谢谢您的帮助。欢迎来到Stack Overflow。你可能也应该从Meteor 1.2迁移:)也许不是一件容易的任务谢谢你,迁移Meteor是我们必须做的事情,但现在不能做,应用程序相当大,所以需要很长时间,所有者需要一个更简单更快的解决方案。这听起来很熟悉,几年内没有维护,然后寻找一个快速解决方案。我希望建立一个运行3.4的mongo服务器——可能是最简单的解决方案——基本上就是xD。是的,这是我们的下一个选择,但首先我们想通过修改Meteor代码来实现。
var result = SalesAppointment.aggregate(pipeline, {cursor: {}});
return result;
var result = SalesAppointment.aggregate(pipeline, {cursor: {}});
return result.toArray();
var result = SalesAppointment.aggregate(pipeline, {cursor: {}});
return new Promise(function (resolve, reject) {
resolve(result.toArray());
});
var result = SalesAppointment.aggregate(pipeline, {cursor: {}});
return new Promise(function (resolve, reject) {
resolve(result);
});
let rawCol = SalesAppointment.rawCollection();
let aggregateQuery = Meteor.wrapAsync(rawCol.aggregate, rawCol);
return aggregateQuery(pipeline, {cursor: {}});
var result = SalesAppointment.rawCollection().aggregate(pipeline, {cursor: {}});
return result;