Commit Graph

4644 Commits

Author SHA1 Message Date
Emily Stark
d3ec00c3ef Fix collection driver upsert callbacks.
Run a bunch of upsert tests on the direct collections (LocalCollection and
MongoConnection). Revealed a weirdness with MongoConnection.upsert(); if there
is no id from the selector or modifier, then mongo ends up generating one and we
don't return it.
2013-10-02 23:00:23 -07:00
Emily Stark
c20db8d328 Remove $'s in selector when upserting new minimongo doc.
Plus test for it.
2013-10-02 21:21:10 -07:00
Slava Kim
0e2d56d382 Glasser's comments on restrictCreationByEmailDomain in Accounts 2013-10-02 20:28:07 -07:00
David Glasser
89df75b15e Add stuff to History.md. 2013-10-02 16:12:13 -07:00
Emily Stark
7f64c726f7 Merge branch 'mongo-upsert' into devel 2013-10-02 13:23:22 -07:00
Emily Stark
86492eecec Fix simulateUpsert call indentation 2013-10-02 12:47:50 -07:00
Emily Stark
dec262b239 Document upsert (first draft) 2013-10-02 12:17:04 -07:00
Naomi Seyfer
67046601ea Merge branch 'cannonical' into devel 2013-10-02 12:11:37 -07:00
Naomi Seyfer
998e805993 more docs and history.md notes 2013-10-02 12:01:24 -07:00
Naomi Seyfer
937bce6e5d Fix docs 2013-10-02 12:01:24 -07:00
Naomi Seyfer
c3fb7741f6 Infinity and NaN in EJSON 2013-10-02 12:01:24 -07:00
Naomi Seyfer
0d8bfbae8a fix tests, rename option, more style fixes 2013-10-02 12:01:21 -07:00
Andrew Wilcox
da6bc1d835 EJSON.stringify objects in sorted key order.
Thus if two objects are EJSON.equals, their serialization strings will
be equal also.

(This should mean that reactive-dict could now allow objects to be
used as the key for `equal`).

Note this change does not affect livedata because livedata uses the
EJSON adjust functions to convert between JSON and EJSON (not
stringify).

Adds a couple options to EJSON.stringify:

* keyOrderSensitive: in parallel with EJSON.equals, outputs objects in
  native key order (the old behavior).

* indent: pretty-prints the output.

The serialization code is based json2, which makes it easy to preserve
the indentation functionality provided by JSON.stringify.  Only enough
code is included to serialize arrays and objects; serializing
primitive values such as strings is delegated to the native
JSON.stringify to reduce code and in case the native implementation is
more efficient.

Include underscore as an explicit dependency in package.js.

Document options to EJSON.equals and EJSON.stringify.
2013-10-02 11:43:44 -07:00
Emily Stark
8d9f97f358 Use a hardcoded example for Meteor.release, for now. 2013-10-02 11:43:16 -07:00
Emily Stark
90aac0ab5a Merge branch 'expire-tokens-fixes' into devel 2013-10-02 11:39:07 -07:00
Emily Stark
e6e4c8a94e Minor token deletion cleanup and comments 2013-10-02 11:37:27 -07:00
Emily Stark
ae6ab2d775 Fix logoutOtherClients docs typos 2013-10-02 11:37:27 -07:00
Emily Stark
f67cf78b2d Add docs for loginExpirationInDays and logoutOtherClients() 2013-10-02 11:37:27 -07:00
Emily Stark
7782d7c95f Make token expiration backwards compatible with numeric when. 2013-10-02 11:36:25 -07:00
Emily Stark
d123e731cc Get rid of connectionCloseDelaySecs 2013-10-02 11:36:25 -07:00
Emily Stark
be8ac4387f Rename _logoutAllOthers to logoutOtherClients 2013-10-02 11:35:51 -07:00
Emily Stark
e69cb036d0 Add fields to user/token deletion observe 2013-10-02 11:35:51 -07:00
Emily Stark
5c08d1c70e Rename and remove some token deletion config flags. 2013-10-02 11:35:51 -07:00
Emily Stark
e8c8252b2a Remove unnecessary bindEnvironmentForWrite 2013-10-02 11:15:00 -07:00
Emily Stark
d0af2d8c91 Add comment about lack of allow/deny rules for upserts 2013-10-02 11:07:41 -07:00
Emily Stark
b29a31746f Rearrange simulateUpsertWithInsertedId() for readability 2013-10-02 10:55:12 -07:00
Emily Stark
44d399456e Clean up some comments and names for upsert. 2013-10-02 10:51:14 -07:00
Emily Stark
47b6af30a5 Factor out the bindEnvironment part of writeCallback.
Get rid of numberAffectedCallback; instead, choose the right return value at
every place where we were using numberAffectedCallback and then pass through
bindEnvironmentForWrite. This cleans up a couple places where we were going
through numberAffectedCallback to wrap a result in an object, and then sometimes
getting the numberAffected out of that object and just returning that. Also
ensures that all callbacks for write get passed through Meteor.bindEnvironment
with the same onException function.
2013-10-02 10:31:30 -07:00
Emily Stark
f9fda934ec Add some comments to minimongo upsert code 2013-10-01 22:16:32 -07:00
Emily Stark
6ae90f4d67 Rename onInsert to isInsert 2013-10-01 19:02:05 -07:00
Emily Stark
cfd5861c8d Make update() the canonical form for upserts on the wire.
update(..., { upsert: true }) returns the number of affected docs, and
update(..., { upsert: true, _returnObject: true }) returns the whole object that
is used by upsert(). Also includes a rename of returnObject -> _returnObject.
2013-10-01 18:26:41 -07:00
David Glasser
dd842072b1 Add .mailmap file to help with updating History.md. 2013-10-01 18:26:13 -07:00
David Glasser
009bd2dce2 Add "patches contributed" to History.md. 2013-10-01 18:13:55 -07:00
Slava Kim
c396f990b4 Doc string saying you can pass a predicate to restrict creation of new users by email. 2013-10-01 17:29:26 -07:00
Slava Kim
bd77b172bd Rename Accounts option 'restrictCreationByEmail' to 'restrictCreationByEmailDomain' 2013-10-01 17:14:30 -07:00
Slava Kim
53756bd80b Allow passing function predicate for domain checks
Escape regexp construction
Don't use &= with Booleans
2013-10-01 17:10:04 -07:00
Slava Kim
b9d8fffddf Sockjs: accept relative base urls
(transform them to absolue urls)
2013-10-01 15:14:09 -07:00
Emily Stark
1002650fcd Update Collection comments to reflect new return values. 2013-10-01 11:48:45 -07:00
Emily Stark
dc8e948cb1 Test and fixes for returning upsert results immediately inside stubs.
Added a test for upsert return values. Factored out some more upsert test
helpers.

Could still use a test for update/remove return values inside a method stub.
2013-10-01 11:39:46 -07:00
Emily Stark
bad2102c06 Return results from collection methods on livedata connection.
This allows us to immediately return local collection return values inside
stubs.
2013-10-01 10:12:02 -07:00
David Glasser
81d9fdf4e3 Rough draft of History.md additions. Covered all changes through ab59ae2.
Includes some XXX notes (some of which are about History.md itself, some of
which are suggestions for things to make sure to address before the next
release).
2013-09-30 19:19:04 -07:00
David Glasser
c9ba1b3ec9 Fix handling of Mongo exit callback (followup to 6358930). 2013-09-30 19:17:59 -07:00
Slava Kim
3a8fc57a24 Fix docs typo. 2013-09-30 18:11:47 -07:00
Slava Kim
008d28c03a Touch History.md regarding fields projection in minimongo. 2013-09-30 18:04:24 -07:00
Slava Kim
60dd2c89ff Clarify minimongo fields docs. 2013-09-30 17:59:07 -07:00
Emily Stark
f397295b8a Suppress invalid modifier log message in upsert test 2013-09-30 15:47:40 -07:00
Geoff Schmidt
b28c817241 Use Random.id rather than the deprecated Meteor.uuid. 2013-09-30 15:41:53 -07:00
David Greenspan
e1dd2b40f8 return un-mongo-converted insertedId
… instead of converting to mongo form and back
2013-09-30 15:41:47 -07:00
Geoff Schmidt
f0e273eaf0 #1063 In parties example, latency compensate object insertion from method. 2013-09-30 15:32:34 -07:00
Emily Stark
ea63ea560f Merge branch 'devel' into mongo-upsert 2013-09-30 15:07:09 -07:00