简体   繁体   English

是Mongo.Collection还是Meteor.Collection?

[英]Is it Mongo.Collection or Meteor.Collection?

In the source code in the example apps I've viewed including http://thejackalofjavascript.com/meteor-js-build-apps-lightning-fast/ and https://www.meteor.com/examples/wordplay the former used Meteor.Collection() and the latter used Mongo.Collection() to define their collections. 在我查看的示例应用程序的源代码中包括http://thejackalofjavascript.com/meteor-js-build-apps-lightning-fast/https://www.meteor.com/examples/wordplay Meteor.Collection()和后者使用Mongo.Collection()来定义它们的集合。 What is the difference between the two and what is the difference in use cases? 两者之间有什么区别,用例的区别是什么?

Meteor.Collection was renamed Mongo.Collection in 0.9.1 . Meteor.Collection0.9.1中被重命名为Mongo.Collection The change is currently backward compatible, however you should switch to using Mongo.Collection for any new projects. 该更改目前是向后兼容的,但是您应该切换到使用Mongo.Collection进行任何新项目。 It looks like the docs have mostly been updated except for the wording in the Data and security section. 看起来除了数据和安全部分中的措辞之外, 文档大多已经更新。

As per change in Meteor 0.9.1: https://github.com/meteor/meteor/blob/devel/History.md#backwards-compatible-renames 根据Meteor 0.9.1的变化: https//github.com/meteor/meteor/blob/devel/History.md#backwards-compatible-renames

Backwards compatible renames: 向后兼容重命名:

Symbol renames: 符号重命名:

Meteor.Collection -> Mongo.Collection Meteor.Collection - > Mongo.Collection

Meteor.Collection.Cursor -> Mongo.Cursor Meteor.Collection.Cursor - > Mongo.Cursor

Meteor.Collection.ObjectID -> Mongo.ObjectID Meteor.Collection.ObjectID - > Mongo.ObjectID

Deps -> Tracker Deps - >追踪器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM