45 Commits

Author SHA1 Message Date
Nick Martin
8991c8bb25 Fix "Cursor is closed" intermittent error.
If the initial _doPoll didn't complete before the first markDirty, two doPolls could be running at once, causing badness.
2012-05-24 19:40:27 -07:00
matt debergalis
986ffbae49 Provide document ID to Meteor.Collection callback. 2012-05-09 11:38:26 -07:00
matt debergalis
f3e0267e3b wrap forEach callback in bindEnvironment 2012-04-27 15:02:12 -07:00
David Greenspan
7e8279f245 shorter, random diff/patch fuzz test; clarify comments 2012-04-26 11:18:06 -07:00
Nick Martin
387f45cb7e Tone down fuzz tests. This makes tests run _much_ faster. 2012-04-19 23:25:11 -07:00
Nick Martin
53ffdefa3e Write directly to _collection if we're on the server and are the default server.
This makes the collection access limited work better.
2012-04-19 23:24:51 -07:00
David Greenspan
4bd98aa38a tinytest/run method now threads the write fence more than before 2012-04-17 20:13:22 -07:00
David Greenspan
df8567dba3 dedup Mongo cursors 2012-04-03 22:40:36 -07:00
David Greenspan
ad4f4ffa5a snapshot tweaks 2012-04-03 22:37:12 -07:00
David Greenspan
5c43f21372 avoid anonymous collection warning 2012-04-03 22:37:12 -07:00
David Greenspan
c09190366e break out fuzz test 2012-04-03 22:37:12 -07:00
David Greenspan
f2d55ccd70 make local mongo-livedata test local 2012-04-03 22:37:12 -07:00
David Greenspan
9ec8922817 isolate fuzz tests in own collections 2012-04-03 22:37:12 -07:00
David Greenspan
bf04fccb72 new query diffing algorithm with fuzz tests 2012-04-03 22:37:11 -07:00
Nick Martin
ee1d25f499 Implement pause/resume in Minimongo. Uses a pessimal diff algorithm. 2012-04-03 22:37:11 -07:00
matt debergalis
7377ce2041 Major formatting and content update to docs. 2012-03-20 16:55:30 -07:00
Geoff Schmidt
5c72fcaacc armAndWait out of test 2012-03-16 23:36:33 -07:00
Geoff Schmidt
c946fc177f make test not async 2012-03-16 23:33:49 -07:00
Geoff Schmidt
4bfc287e5d New server-side results diffing algorithm 2012-03-16 21:11:08 -07:00
Geoff Schmidt
a00ee63574 some basic tests for mongo-livedata 2012-03-16 21:11:08 -07:00
Geoff Schmidt
3edf56e7af Honor sort/skip/limit on server 2012-03-16 18:26:19 -07:00
Geoff Schmidt
b3fc3150d4 simplify signature of observe()'s remove callback 2012-03-16 18:26:19 -07:00
Nick Martin
d7dd1d9408 Fix typo that broke count(). 2012-03-16 15:55:57 -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
Geoff Schmidt
c6cedac7eb Test database failure reporting 2012-03-16 02:55:14 -07:00
Geoff Schmidt
6de5ab62ce Simplify method API 2012-03-16 02:55:14 -07:00
Geoff Schmidt
7be206b11a database writes can report errors (first pass) 2012-03-16 02:55:14 -07:00
Geoff Schmidt
ef46d1ea58 eliminate App, proxy methods from Meteor 2012-03-16 02:55:14 -07:00
matt debergalis
5b00c13d82 g/c unused name field, out of date note. 2012-03-07 16:37:17 -08:00
Geoff Schmidt
3dc8dc2887 Permit fine-grained control of database polling.
You can now used invalidation keys to specify exactly what will get polled when.
2012-03-06 15:44:42 -08:00
Geoff Schmidt
14d41036f4 Simplify subscription API
- Use positional arguments
- Pass the subscription object in 'this'
2012-03-06 15:44:42 -08:00
Geoff Schmidt
dd6f013e9b generalize write fencing to support all databases 2012-03-06 15:44:41 -08:00
Geoff Schmidt
60913bfd6f Notify observers asynchronously, add write fencing 2012-03-02 01:41:06 -08:00
matt debergalis
b35af422c6 Support field selection in server-side mongo.
Can now publish subsets of documents with something like this:

Meteor.publish('items', function (sub, params) {
  return Items.find({user_id: params.user_id},
                    {fields: {some_secret_field: 0}});
});

where items.some_secret_fields won't be included in the publish output.

(fields option is ignored by minimongo.)
2012-02-29 16:08:58 -08:00
matt debergalis
cb887f5a9b Rework livedata (DDP) subscriptions.
Publish now comes in three flavors:

* Bare metal API: Meteor.publish(name, func).

  Server will call func(sub, params) each time a client subscribes to
  "name" (with supplied "params"), or if "name" is null, each time a new
  client connects (autopublish).  "sub" is a Subscription object, which
  supplies sub.set(), sub.unset(), sub.satisfies(), and sub.flush()
  methods to emit DDP data messages.  func() should register a cleanup
  function with sub.onStop(), which will be called when client unsubs.

  To react to database changes, use Collection.observe().  Publish
  functions that are not database backed may use some other mechanism
  (setInterval?) to schedule calls to sub.set().

* publishCursor API:

  If func() *returns* a Cursor, server will automatically publish all
  results from that cursor as the collection with the same name as the
  cursor's underlying Mongo collection.  For example:

  Meteor.publish('top10', function (sub, params) {
    return Players.find({}, {sort: {score: -1}, limit: 10});
  });

  will define a 'top10' publish that is always the top 10 scoring
  players, published to the 'players' collection on each subscribing
  client.

* autopublish

  When the autopublish package is loaded, all Collections defined on the
  server will automatically be published, in their entirety, to each
  connected client.  Clients need not call Meteor.subscribe().  Calls to
  publish() will emit a warning message, since they are superflous.  To
  disable autopublish, run "meteor remove autopublish".
2012-02-29 16:08:58 -08:00
Geoff Schmidt
5cf9351ecd Test compound methods, including clients cheating 2012-02-29 04:36:51 -08:00
Geoff Schmidt
97c3e50379 Support server-side tests. 2012-02-23 06:08:09 -08:00
Geoff Schmidt
58a2d65126 Provide package 'meteor' to create the Meteor global
Fold old package 'core' into it
2012-02-23 02:21:10 -08:00
David Greenspan
08c3d13465 prevent collection remove from triggering add 2012-02-21 15:25:34 -08:00
Geoff Schmidt
1d3154bd54 livedata fixes 2012-02-19 14:44:32 -08:00
David Greenspan
5385c4a358 missing underscore 2012-02-17 20:48:17 -08:00
Geoff Schmidt
7a8e7f5ea3 data refactoring cleanups in some tests 2012-02-17 01:33:18 -08:00
Geoff Schmidt
c88dc05ff3 add "universal publishes" for smooth autopublish experience 2012-02-17 01:02:51 -08:00
Geoff Schmidt
3e47029a61 port skel, todos, leaderboard to new data API 2012-02-17 01:02:34 -08:00
Geoff Schmidt
5d069169a9 factor mongo-specific parts out of livedata 2012-02-16 23:07:00 -08:00