Commit Graph

16 Commits

Author SHA1 Message Date
David Greenspan
5418f34887 Whitespace 2014-10-22 10:55:12 -07:00
Sashko Stubailo
1ac45850de Replace todos with new example 2014-09-29 21:09:25 -07:00
Sashko Stubailo
82d1db5107 Rename Meteor.Collection to Mongo.Collection again 2014-08-29 12:28:32 -07:00
Sashko Stubailo
6b3d31ff5b Revert "Rename Meteor.Collection -> Mongo.Collection"
This reverts commit 96952dda2b.

Conflicts:
	packages/ddp/livedata_tests.js
	packages/minimongo/minimongo.js
	packages/mongo/collection.js
	packages/mongo/mongo_driver.js
	packages/mongo/mongo_livedata_tests.js
	packages/mongo/oplog_tests.js
	packages/reactive-dict/reactive-dict.js
	packages/session/session_tests.js
	tools/auth.js
2014-08-29 12:26:28 -07:00
Sashko Stubailo
96952dda2b Rename Meteor.Collection -> Mongo.Collection 2014-08-29 10:11:21 -07:00
David Glasser
f67db983c3 New check library. 2013-04-18 19:17:53 -07:00
matt debergalis
0a0a4bbb87 i think you meant 6502 2012-04-10 12:06:41 -07:00
Geoff Schmidt
6934fb2efb use consistent data between examples 2012-04-10 12:04:00 -07:00
David Greenspan
117e9e0467 additional documentation etc in todos 2012-04-05 16:47:04 -07:00
Geoff Schmidt
8cdadb3762 make insert return the id of the new object
(not a copy of the new object)
avoid updating docs to prevent merge conflict
(will handle out of band)
2012-03-16 02:55:14 -07:00
Nick Martin
10236609f4 Ensure unique timestamp when adding new entries.
Fixes issue where the order would dance around as you modify items.
2012-03-06 15:45:24 -08:00
matt debergalis
44fb1d2150 use findOne() and set initial timestamp on items. 2012-01-30 12:03:18 -08:00
matt debergalis
5e7daaaff3 New Collection API
The new Collection API separates query handles from result sets.  It
allows template iterators to only redraw changed objects instead of
entire result sets.  This implementation also sets the stage for
minimongo indexes and better invalidation performance.

collection.find() now returns a Collection.Query handle.  To retrieve
results we provide these methods on Collection.Query:

Iterators (encouraged way to access results):

 * query.forEach(function (obj) { ... });
 * results = query.map(function (obj) { ... });

Cursor-based retrieval (iterators are built on fetch):

 * docs = query.fetch(maxlen); // return next [maxlen] (all) docs.
 * doc = query.get(skip);      // return next doc, skipping [skip] (0) docs.

Counter:

 * length = query.count(); // number of results in query.

Live queries (replaces findLive):

 * live_handle = query.observe({added: function (obj, idx) { ... },
                                removed: function (id, idx) { ... },
                                changed: function (obj, idx) { ... },
                                moved: function (obj, old_idx, new_idx) { ... }});

Convenience finders:

 * doc = collection.findOne({color: 'red'});
 * doc = collection.findOne(id_val);

On the client, calling forEach(), map(), fetch(), get(), or findOne()
inside an invalidation context will register a dependency on the entire
query result.  Any change to any objects invalidates the context.

Calling count() inside an invalidation context will register a
dependency that only triggers if objects enter or leave the result set.

Calling observe() does not register a dependency.
2012-01-27 20:59:08 -08:00
Nick Martin
3faff2de78 perl -pi -e 's/Sky/Meteor/g' **/* 2012-01-04 20:52:46 -08:00
Nick Martin
23cd5b6912 perl -pi -e 's/Skybreak/Meteor/g' **/* 2012-01-04 18:30:25 -08:00
Geoff Schmidt
0599d5198c move examples into main repo 2011-12-07 21:22:47 -08:00