我最近更新到Meteor 1.2.1并将我的项目部署到流星开发服务器{app} .meteor.com但是,这样做后我开始注意到我的mongo更新语句中的$ currentDate修饰符出错。
这在更新之前工作,实际上在本地工作。但是,似乎在部署上打破了。对此的想法?
代码:
Members.update({burnId: burnId, "isViewing": { $eq : false}}, { $inc: { "numUnreadMessages": 1}, $currentDate: {updatedAt: true}}, {multi: true});
更新:我实际上运行meteor mongo {app}.meteor.com
并尝试运行一个简单的更新命令db.collection.update({_id: "1234"}, {$currentDate: {updatedAt: true}})
,它在本地副本上运行,但在部署版本上没有。
我假设meteor的部署服务器(免费)在运行Meteor 1.2时遇到问题。有办法解决这个问题吗?我还假设这将由Galaxy修复,但唉,目前还没有普通大众可以使用。
日志:
[Sun Sep 27 2015 15:56:51 GMT+0000 (UTC)] INFO Exception while invoking method 'sendMessage' MongoError: Invalid modifier specified $currentDate
at Object.Future.wait (/meteor/dev_bundles/0.5.13/lib/node_modules/fibers/future.js:398:15)
at [object Object].<anonymous> (packages/meteor/helpers.js:119:1)
at [object Object].MongoConnection.(anonymous function) (packages/mongo/mongo_driver.js:736:1)
at [object Object].mongoConnectionProto.(anonymous function) [as update] (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2923:1)
at OptimizedApply (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:271:1)
at Object.ret.(anonymous function) [as update] (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2881:1)
at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/mongo/collection.js:586:1)
at [object Object].Meteor.methods.sendMessage (server/Methods.js:124:1)
at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2554:1)
at maybeAuditArgumentChecks (livedata_server.js:1692:12)
- - - - -
at Object.toError (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
at /meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/collection/core.js:636:22
at Server.Base._callHandler (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
at /meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:488:18
at [object Object].MongoReply.parseBody
(/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at [object Object].<anonymous> (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:446:20)
at [object Object].emit (events.js:95:17)
at [object Object].<anonymous>
(/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
at [object Object].emit (events.js:98:17)
at Socket.<anonymous> (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:440:22)
[Sun Sep 27 2015 15:56:54 GMT+0000 (UTC)] INFO Exception while invoking method 'sendMessage' MongoError: Invalid modifier specified $currentDate
at Object.Future.wait (/meteor/dev_bundles/0.5.13/lib/node_modules/fibers/future.js:398:15)
at [object Object].<anonymous> (packages/meteor/helpers.js:119:1)
at [object Object].MongoConnection.(anonymous function) (packages/mongo/mongo_driver.js:736:1)
at [object Object].mongoConnectionProto.(anonymous function) [as update] (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2923:1)
at OptimizedApply (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:271:1)
at Object.ret.(anonymous function) [as update] (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2881:1)
at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/mongo/collection.js:586:1)
at [object Object].Meteor.methods.sendMessage (server/Methods.js:124:1)
at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2554:1)
at maybeAuditArgumentChecks (livedata_server.js:1692:12)
- - - - -
at Object.toError (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
at /meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/collection/core.js:636:22
at Server.Base._callHandler (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
at /meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:488:18
at [object Object].MongoReply.parseBody
(/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at [object Object].<anonymous> (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:446:20)
at [object Object].emit (events.js:95:17)
at [object Object].<anonymous>
(/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
at [object Object].emit (events.js:98:17)
at Socket.<anonymous> (/meteor/containers/951f3aa3-e3e5-e5bf-afc8-323fba10ef52/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:440:22)
答案 0 :(得分:0)
这是Meteor的免费版本的问题。使用更新版本的mongo可以解决问题。