mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Expose Mongo timestamp class a little more.
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
* these outside of a fiber they will explode!
|
||||
*/
|
||||
|
||||
MongoLivedataTest = {};
|
||||
|
||||
var path = Npm.require('path');
|
||||
var MongoDB = Npm.require('mongodb');
|
||||
var Fiber = Npm.require('fibers');
|
||||
@@ -993,7 +991,7 @@ _.extend(LiveResultsSet.prototype, {
|
||||
// - If you disconnect and reconnect from Mongo, it will essentially restart
|
||||
// the query, which will lead to duplicate results. This is pretty bad,
|
||||
// but if you include a field called 'ts' which is inserted as
|
||||
// new MongoLivedataTest.MongoTimestamp(0, 0) (which is initialized to the
|
||||
// new MongoConnection.MongoTimestamp(0, 0) (which is initialized to the
|
||||
// current Mongo-style timestamp), we'll be able to find the place to
|
||||
// restart properly. (This field is specifically understood by Mongo with an
|
||||
// optimization which allows it to find the right place to start without
|
||||
@@ -1082,5 +1080,5 @@ MongoConnection.prototype._observeChangesTailable = function (
|
||||
|
||||
// XXX We probably need to find a better way to expose this. Right now
|
||||
// it's only used by tests, but in fact you need it in normal
|
||||
// operation to interact with capped collections.
|
||||
MongoLivedataTest.MongoTimestamp = MongoDB.Timestamp;
|
||||
// operation to interact with capped collections (eg, Galaxy uses it).
|
||||
MongoConnection.MongoTimestamp = MongoDB.Timestamp;
|
||||
|
||||
@@ -206,7 +206,7 @@ if (Meteor.isServer) {
|
||||
self.xs = [];
|
||||
self.expects = [];
|
||||
self.insert = function (fields) {
|
||||
coll.insert(_.extend({ts: new MongoLivedataTest.MongoTimestamp(0, 0)},
|
||||
coll.insert(_.extend({ts: new Meteor._Mongo.MongoTimestamp(0, 0)},
|
||||
fields));
|
||||
};
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ Package.on_use(function (api) {
|
||||
// questionable reasons) initialized by the webapp package.
|
||||
api.use('webapp', 'server', {weak: true});
|
||||
|
||||
api.export('MongoLivedataTest', 'server', {testOnly: true});
|
||||
|
||||
api.add_files('mongo_driver.js', 'server');
|
||||
api.add_files('local_collection_driver.js', ['client', 'server']);
|
||||
api.add_files('remote_collection_driver.js', 'server');
|
||||
|
||||
Reference in New Issue
Block a user