Skip to content

Commit

Permalink
Rename Meteor.Collection -> Mongo.Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashko Stubailo committed Aug 29, 2014
1 parent 65491b7 commit 96952dd
Show file tree
Hide file tree
Showing 65 changed files with 299 additions and 264 deletions.
2 changes: 1 addition & 1 deletion examples/leaderboard/leaderboard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Set up a collection to contain player information. On the server,
// it is backed by a MongoDB collection named "players".

Players = new Meteor.Collection("players");
Players = new Mongo.Collection("players");

if (Meteor.isClient) {
Template.leaderboard.players = function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/other/client-info/client-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (Meteor.isServer) {

if (Meteor.isClient) {
Meteor.subscribe("clientInfo");
var ClientInfo = new Meteor.Collection("clientInfo");
var ClientInfo = new Mongo.Collection("clientInfo");

Template.info.info = function () {
return EJSON.stringify(ClientInfo.findOne("info"), {indent: true});
Expand Down
2 changes: 1 addition & 1 deletion examples/other/login-demo/login-demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Gizmos = new Meteor.Collection("gizmos");
Gizmos = new Mongo.Collection("gizmos");

if (Meteor.isClient) {

Expand Down
6 changes: 3 additions & 3 deletions examples/other/quiescence/quiescence.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Time = new Meteor.Collection("time");
Results = new Meteor.Collection("results");
Magic = new Meteor.Collection("magic");
Time = new Mongo.Collection("time");
Results = new Mongo.Collection("results");
Magic = new Mongo.Collection("magic");

if (Meteor.isServer) {
Meteor.publish("time", function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/other/template-demo/client/d3.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7031,4 +7031,4 @@
d3.time.scale.utc = function() {
return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat);
};
})();
})();
2 changes: 1 addition & 1 deletion examples/other/template-demo/client/template-demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Timers = new Meteor.Collection(null);
Timers = new Mongo.Collection(null);

///////////////////////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion examples/other/template-demo/model.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Circles = new Meteor.Collection("circles");
Circles = new Mongo.Collection("circles");
2 changes: 1 addition & 1 deletion examples/parties/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
invited: Array of user id's that are invited (only if !public)
rsvps: Array of objects like {user: userId, rsvp: "yes"} (or "no"/"maybe")
*/
Parties = new Meteor.Collection("parties");
Parties = new Mongo.Collection("parties");

Parties.allow({
insert: function (userId, party) {
Expand Down
4 changes: 2 additions & 2 deletions examples/todos/client/todos.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Client-side JavaScript, bundled and sent to client.

// Define Minimongo collections to match server/publish.js.
Lists = new Meteor.Collection("lists");
Todos = new Meteor.Collection("todos");
Lists = new Mongo.Collection("lists");
Todos = new Mongo.Collection("todos");

// ID of currently selected list
Session.setDefault('list_id', null);
Expand Down
4 changes: 2 additions & 2 deletions examples/todos/server/publish.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Lists -- {name: String}
Lists = new Meteor.Collection("lists");
Lists = new Mongo.Collection("lists");

// Publish complete set of lists to all clients.
Meteor.publish('lists', function () {
Expand All @@ -12,7 +12,7 @@ Meteor.publish('lists', function () {
// tags: [String, ...],
// list_id: String,
// timestamp: Number}
Todos = new Meteor.Collection("todos");
Todos = new Mongo.Collection("todos");

// Publish all items for requested list_id.
Meteor.publish('todos', function (list_id) {
Expand Down
2 changes: 1 addition & 1 deletion examples/unfinished/atoms/atoms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ if (Meteor.isClient) {
Template.atom.textY = function () {
return this.y + 8;
};
}
}
4 changes: 2 additions & 2 deletions examples/unfinished/azrael/model.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// XXX it is actually very dangerous to store times as Number. use
// Date type once it's implemented in minimongo
Rooms = new Meteor.Collection("rooms");
Rooms = new Mongo.Collection("rooms");
//Rooms.schema({name: String, created: Number});

Chat = new Meteor.Collection("chat");
Chat = new Mongo.Collection("chat");
/*
Chat.schema({room: String, message: String,
username: String, created: Number});
Expand Down
2 changes: 1 addition & 1 deletion examples/unfinished/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var generateDoc = function () {

var Collections = [];
_.times(PARAMS.numCollections, function (n) {
Collections.push(new Meteor.Collection("Collection" + n));
Collections.push(new Mongo.Collection("Collection" + n));
});


Expand Down
4 changes: 2 additions & 2 deletions examples/unfinished/chat-benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ var randomString = function (length) {
//////////////////////////////


Rooms = new Meteor.Collection("rooms");
Messages = new Meteor.Collection("messages");
Rooms = new Mongo.Collection("rooms");
Messages = new Mongo.Collection("messages");


if (Meteor.isServer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Leaderboard = DDP.connect("http://leader2.meteor.com/sockjs");

// XXX I'd rather this be Leaderboard.Players.. can this API be easier?
Players = new Meteor.Collection("players", {manager: Leaderboard});
Players = new Mongo.Collection("players", {manager: Leaderboard});

Template.main.events = {
'keydown': function () {
Expand Down
4 changes: 2 additions & 2 deletions examples/unfinished/reorderable-list/lib/items.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Items = new Meteor.Collection("items");
Items = new Mongo.Collection("items");

if (Meteor.isServer) {
if (Items.find().count() === 0) {
_.each(
["violet", "unicorn", "flask", "jar", "leitmotif", "rearrange", "right", "ethereal"],
function (text, index) { Items.insert({text: text, rank: index}); });
}
}
}
2 changes: 1 addition & 1 deletion examples/unfinished/todos-backbone/common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Todos = new Meteor.Collection("todos");
Todos = new Mongo.Collection("todos");
//Todos.schema({text: String, done: Boolean, order: Number});

if (Meteor.isServer) {
Expand Down
2 changes: 1 addition & 1 deletion examples/unfinished/todos-underscore/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ $(function () {
// support aggregate queries, construct a local collection to serve
// the same purpose, and drive the renderList() off of it.

var LocalTags = new Meteor.Collection;
var LocalTags = new Mongo.Collection;
(function () {
function updateLocalTags() {
var real = _(Todos.find()).chain().pluck('tags').compact().flatten().uniq().value();
Expand Down
6 changes: 3 additions & 3 deletions examples/unfinished/todos-underscore/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Lists = new Meteor.Collection("lists");
Lists = new Mongo.Collection("lists");

Todos = new Meteor.Collection("todos");
Todos = new Mongo.Collection("todos");

/* Schema support coming soon!
Expand All @@ -19,4 +19,4 @@ if (Meteor.isServer) {
Meteor.publish('todos', function () {
return Todos.find();
});
}
}
6 changes: 3 additions & 3 deletions examples/wordplay/model.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
////////// Shared code (client and server) //////////

Games = new Meteor.Collection('games');
Games = new Mongo.Collection('games');
// { board: ['A','I',...], clock: 60,
// players: [{player_id, name}], winners: [player_id] }

Words = new Meteor.Collection('words');
Words = new Mongo.Collection('words');
// {player_id: 10, game_id: 123, word: 'hello', state: 'good', score: 4}

Players = new Meteor.Collection('players');
Players = new Mongo.Collection('players');
// {name: 'matt', game_id: 123}

// 6 faces per die, 16 dice. Q really means Qu.
Expand Down
4 changes: 2 additions & 2 deletions packages/accounts-base/accounts_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ if (Meteor.isClient) {
// XXX Allow users to configure this collection name.

/**
* @summary A [Meteor.Collection](#collections) containing user documents.
* @summary A [Mongo.Collection](#collections) containing user documents.
* @locus Anywhere
*/
Meteor.users = new Meteor.Collection("users", {
Meteor.users = new Mongo.Collection("users", {
_preventAutopublish: true,
connection: Meteor.isClient ? Accounts.connection : Meteor.connection
});
Expand Down
6 changes: 3 additions & 3 deletions packages/application-configuration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ var collectionFuture = new Future();

Meteor.startup(function () {
if (ultra) {
Apps = new Meteor.Collection("apps", {
Apps = new Mongo.Collection("apps", {
connection: ultra
});
Jobs = new Meteor.Collection("jobs", {
Jobs = new Mongo.Collection("jobs", {
connection: ultra
});
Services = new Meteor.Collection('services', {
Services = new Mongo.Collection('services', {
connection: ultra
});
// allow us to block on the collections being ready
Expand Down
2 changes: 1 addition & 1 deletion packages/autoupdate/autoupdate_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var autoupdateVersionRefreshable =
__meteor_runtime_config__.autoupdateVersionRefreshable || "unknown";

// The collection of acceptable client versions.
ClientVersions = new Meteor.Collection("meteor_autoupdate_clientVersions");
ClientVersions = new Mongo.Collection("meteor_autoupdate_clientVersions");

Autoupdate = {};

Expand Down
2 changes: 1 addition & 1 deletion packages/autoupdate/autoupdate_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var Future = Npm.require("fibers/future");
Autoupdate = {};

// The collection of acceptable client versions.
ClientVersions = new Meteor.Collection("meteor_autoupdate_clientVersions",
ClientVersions = new Mongo.Collection("meteor_autoupdate_clientVersions",
{ connection: null });

// The client hash includes __meteor_runtime_config__, so wait until
Expand Down
2 changes: 1 addition & 1 deletion packages/ctl-helper/.npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ctl-helper/ctl-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ _.extend(Ctl, {
},

jobsCollection: _.once(function () {
return new Meteor.Collection("jobs", {manager: Ctl.findGalaxy()});
return new Mongo.Collection("jobs", {manager: Ctl.findGalaxy()});
}),

// use _.memoize so that this is called only once per app.
Expand Down
2 changes: 1 addition & 1 deletion packages/ddp/.npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions packages/ddp/livedata_connection_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Tinytest.add("livedata stub - receive data", function (test) {

// XXX: Test that the old signature of passing manager directly instead of in
// options works.
var coll = new Meteor.Collection(coll_name, conn);
var coll = new Mongo.Collection(coll_name, conn);

// queue has been emptied and doc is in db.
test.isUndefined(conn._updatesForUnknownStores[coll_name]);
Expand Down Expand Up @@ -386,7 +386,7 @@ if (Meteor.isClient) {
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});

// setup method
conn.methods({do_something: function (x) {
Expand Down Expand Up @@ -533,7 +533,7 @@ if (Meteor.isClient) {
startAndConnect(test, stream);

var coll_name = Random.id();
var coll = new Meteor.Collection(coll_name, {connection: conn});
var coll = new Mongo.Collection(coll_name, {connection: conn});

// setup methods
conn.methods({
Expand Down Expand Up @@ -619,7 +619,7 @@ Tinytest.add("livedata stub - reconnect", function (test) {
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});

var o = observeCursor(test, coll.find());

Expand Down Expand Up @@ -750,7 +750,7 @@ if (Meteor.isClient) {
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});
var o = observeCursor(test, coll.find());

conn.methods({writeSomething: function () {
Expand Down Expand Up @@ -923,7 +923,7 @@ Tinytest.add("livedata stub - reconnect method which only got data", function (t
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});
var o = observeCursor(test, coll.find());

// Call a method. We'll get the data-done message but not the result before
Expand Down Expand Up @@ -1009,7 +1009,7 @@ if (Meteor.isClient) {
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});
var o = observeCursor(test, coll.find());

conn.methods({
Expand Down Expand Up @@ -1096,7 +1096,7 @@ if (Meteor.isClient) {
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});

conn.methods({
insertSomething: function () {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ Tinytest.add("livedata connection - two wait methods", function (test) {
startAndConnect(test, stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});

// setup method
conn.methods({do_something: function (x) {}});
Expand Down Expand Up @@ -1682,7 +1682,7 @@ if (Meteor.isClient) {
var conn = newConnection(stream);

var collName = Random.id();
var coll = new Meteor.Collection(collName, {connection: conn});
var coll = new Mongo.Collection(collName, {connection: conn});

// Start and send "connect", but DON'T get 'connected' quite yet.
stream.reset(); // initial connection start.
Expand Down
8 changes: 4 additions & 4 deletions packages/ddp/livedata_test_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if (Meteor.isServer) {

/*****/

Ledger = new Meteor.Collection("ledger");
Ledger = new Mongo.Collection("ledger");
Ledger.allow({
insert: function() { return true; },
update: function() { return true; },
Expand Down Expand Up @@ -147,7 +147,7 @@ Meteor.methods({

/// Helpers for "livedata - changing userid reruns subscriptions..."

objectsWithUsers = new Meteor.Collection("objectsWithUsers");
objectsWithUsers = new Mongo.Collection("objectsWithUsers");

if (Meteor.isServer) {
objectsWithUsers.remove({});
Expand Down Expand Up @@ -313,8 +313,8 @@ if (Meteor.isServer) {
/*****/

/// Helpers for "livedata - publish multiple cursors"
One = new Meteor.Collection("collectionOne");
Two = new Meteor.Collection("collectionTwo");
One = new Mongo.Collection("collectionOne");
Two = new Mongo.Collection("collectionTwo");

if (Meteor.isServer) {
One.remove({});
Expand Down
Loading

0 comments on commit 96952dd

Please sign in to comment.