Commit Graph

574 Commits

Author SHA1 Message Date
David Glasser
21bdac8734 Merge branch 'master' into devel
Conflicts:
	History.md
	packages/accounts-password/package.js
	packages/accounts-password/password_server.js
	packages/constraint-solver/package.js
	packages/meteor-tool/package.js
	packages/non-core/npm-bcrypt/package.js
	packages/package-version-parser/package-version-parser-tests.js
	packages/package-version-parser/package-version-parser.js
	packages/package-version-parser/package.js
	tools/selftest.js
2015-03-17 13:41:14 -07:00
David Glasser
4daaa76b12 METEOR@1.0.4 2015-03-17 13:06:07 -07:00
Slava Kim
dab2782434 Document a whole bunch of missing arguments/returns 2015-03-14 23:04:09 -07:00
David Glasser
af0469da35 Bump other packages to -rc.0 2015-03-05 22:54:07 -08:00
David Glasser
d7b7ab6474 minimongo: Disallow setting empty fields
This matches the MongoDB 2.6 behavior:
https://github.com/mongodb/mongo/commit/c18c7b22d
2015-03-05 19:56:41 -08:00
David Glasser
cb7664c220 Always apply projection to docs, not diffs
Projection functions act on *documents*, not the diffs that are passed
to changed callbacks.  For example, a projection `{'a.b': 1}` applied to
the *document* `{a: undefined}` will result in `{}`, but the *diff*
of `{a: undefined}` on a query with that projection should still result
in a `changed` callback with that diff being invoked.

Refactor various parts of minimongo to always have a projectionFn for
each observed query (perhaps a trivial one).

Pass the projection into _diffQueryChanges so that it can apply the
projection *before* taking the diff, in the two cases in Minimongo which
use _diffQueryChanges instead of direct application. (We could instead
make the query's results and resultsSnapshot be projected, but Minimongo
currently relies on the fact that these data structures alias the
documents stored in the collection.)

Stop applying the projection to the diffs in changed via
wrapCallback. (We could still use wrapCallback to apply the projection
for added/addedBefore calls, but it seems more consistent to use the
same mechanisms for added that we use for changed.

Fixes #3800.  Fixes #2254. Fixes #3571.
2015-03-05 18:41:38 -08:00
Slava Kim
16d516522f Apply fields projection on documents before diffing them for Minimongo's changed event.
This change actually introduces another layer of projections before diffing, in
addition to more projection after the diffing, on the result.

I didn't figure out why, but the tests fail if you remove either of them.

Adds tests. Fixes #2254.
2015-03-05 18:41:38 -08:00
David Glasser
4a5c980baa Don't doubly-wrap transforms
LocalCollection.wrapTransform is idempotent, so it's OK to doubly-wrap
them, but it's slightly more efficient to notice that a transform has
already been wrapped and not re-wrap it.

(One place where we doubly-wrap transforms is in SynchronousCursor,
which calls wrapTransform on a transform that probably came from
Mongo.Collection, which also wrapped it.)

Fixes #3623.
2015-03-05 17:09:36 -08:00
David Glasser
bb638b7694 minimongo: Find paused flag in the right place
The `paused` flag is stored on LocalCollection, but two places in
minimongo looked for it on the `query` object (which represents an
active observeChanges call).  In both cases, the bug had no correctness
impact but could have a performance impact.

Bug 1:

`_recomputeResults` (used to calculate changes to skip and limit
queries) tried to avoid calculating the diff if the collection had been
paused (by pauseObservers as part of latency compensation), but it
looked for the `paused` flag in the wrong place and always ran the diff.

This didn't have an effect on correctness (because the wrapped callbacks
on `query` are no-ops when `paused` is set) but did waste time on
unnecessary diffs.

Bug 2:

In `update`, we tried to avoid saving original results for skip/limit
queries if the collection was paused, because we don't actually run the
diff for paused queries.  (Well, except for the fact that Bug 1 made us
run the diffs anyway...)  But since we checked `query.paused` instead of
`self.paused`, we wasted time cloning the results even if we were
paused.

Reviewed at https://rbcommons.com/s/meteor/r/4/
2015-03-04 18:56:57 -08:00
Sashko Stubailo
f29c954458 Bump a bunch of version numbers for new preview 2015-02-09 13:23:24 -08:00
David Glasser
a83008ebb4 Make our upserts match 2.6 semantics
Mongo 2.4 had the following behavior: if

  c.update({_id: 'x'}, {y: 1}, {upsert: 1})

resulted in an insert, it would get a random _id instead of 'x'.  (This
only happened when the update was a "replacement" rather than a
"modifier".) We dutifully implemented this behavior in various parts of
Meteor and added tests to prove that it occured.

However, this was actually a bug which got fixed in Mongo 2.6:
https://jira.mongodb.org/browse/SERVER-5289

Since this was regarded by Mongo as a bug (not a backwards-incompatible
change deemed worthy of mention in the Mongo 2.6 release notes), we
should just make Meteor always behave the Mongo 2.6 way, no matter what
version we're on (at least in the aspects where Meteor has its own code
to control this).  In other parts of Meteor where the queries are just
getting processed by Mongo, the behavior of this special case will match
Mongo's behavior.  If you care strongly about consistent behavior in
this strange edge case, upgrade to Mongo 2.6!

Specifically:

 - The minimongo implementation of modifiers loses its special-case code
   which drops _id from the modified document during an upsert replace.
 - Mongo.Collection.update should only generate a random _id as an
   insertedId if the selector doesn't mention one.
 - The case of a selector mentioning _id and a *replacement* modifier
   not mentioning _id should still count as "known ID" in the
   lower-level MongoConnection.update, which means that there's no
   reason to use simulated upsert and that we should include it as
   insertedId in the return object.
 - Various tests of the previous behavior should be changed.

(Note that if this commit is cherry-picked onto 1.0.3.1 (ie, run against
2.4), it would fail, because some of the tested cases end up going to
unsimulated Mongo upsert and assume the 2.6 behavior. That's OK, as
described above.)

Fixes #2278.
2015-02-05 22:40:44 -08:00
Sashko Stubailo
b3cb7a49f7 Merge branch 'devel' into windows-cr
Conflicts:
	packages/application-configuration/package.js
	packages/ctl-helper/package.js
	packages/ctl/package.js
	packages/dev-bundle-fetcher/package.js
	packages/follower-livedata/package.js
	packages/jquery/package.js
	packages/star-translate/package.js
	packages/test-in-browser/package.js
	tools/bundler.js
	tools/compiler.js
	tools/package-client.js
	tools/package-source.js
	tools/package-version-parser.js
	tools/server/boot.js
2015-02-04 13:56:54 -08:00
Denis Gorbachev
44bbd7f34c Cleanup Minimongo.Matcher instantiation
We've actually been wrapping our head over passing collection to Minimongo.Matcher before realizing that it doesn't really use the second argument.
2015-02-03 13:22:28 -08:00
Slava Kim
27f249bfed A lot of crazy package bumps 2015-01-21 14:03:55 -08:00
David Glasser
6b204ca73a Bump package versions for 1.0.2 2014-12-19 10:31:59 -08:00
David Glasser
73b809c122 Bump versions for 1.0.2. 2014-12-11 22:44:41 -08:00
David Glasser
0ed8a9b32d bump package versions for a test release 2014-12-10 14:50:11 -08:00
David Glasser
6ea8443f30 Update calls to addFiles, onUse, and onTest 2014-12-09 20:18:31 -08:00
Sashko Stubailo
0cdc382a72 Replace occurences of "elide" with "omit" 2014-12-05 15:32:57 -08:00
David Glasser
de5f68cf70 bump all versions (due to source-map upgrade) 2014-11-25 09:06:26 -08:00
Sashko Stubailo
14735344f4 Revert "Change all uses of word elide to omit"
This reverts commit 442274f266.
2014-11-14 10:49:37 -08:00
Sashko Stubailo
442274f266 Change all uses of word elide to omit 2014-11-14 10:21:34 -08:00
Slava Kim
cc82180925 More return tags for Collections 2014-11-02 03:28:37 -08:00
Emily Stark
cb54ae18fb Merge branch 'master' into devel
Conflicts:
	History.md
	examples/localmarket/.meteor/release
	examples/localmarket/.meteor/versions
	packages/stylus/README.md
	tools/compiler.js
	tools/package-client.js
	tools/tests/old/app-with-private/.meteor/versions
	tools/tests/old/app-with-public/.meteor/versions
	tools/tests/old/empty-app/.meteor/versions
2014-10-28 10:42:30 -07:00
Avital Oliver
2ca942f9cb Correct links to www.meteor.com project pages 2014-10-28 02:54:45 -07:00
Emily Stark
b4c10d8f61 bump package versions 2014-10-28 02:49:54 -07:00
Slava Kim
7774d1fa51 Readme for minimongo 2014-10-23 14:50:00 -07:00
Emily Stark
827b206c02 bump package version numbers for 1.0-rc.0 2014-10-17 16:10:40 -07:00
Slava Kim
52d90fa316 Add comments about regexp flags affected 2014-10-15 13:23:06 -07:00
Slava Kim
f080d010a0 Add tests for #2817 2014-10-14 22:07:14 -07:00
Slava Kim
650ca70fe6 Reset the state of regex in minimongo on matching
Fixes #2817. Regular Expressions in JavaScript keep the state when matching for
the same string. When there are two documents with the same value of the
matching field, the minimongo can incorrectly filter collection because regexp
would return different values on different calls.
2014-10-14 21:53:01 -07:00
David Glasser
dbef8b7247 Improve error message for limited ordered observe
See #1643.
2014-10-13 17:26:09 -07:00
Sashko Stubailo
36da5aecb4 Make all version numbers not have rc 2014-10-13 14:09:37 -07:00
Sashko Stubailo
698fbedb10 Bump all of the version numbers to rc.0 2014-10-07 17:10:48 -07:00
Sashko Stubailo
1e53f6b598 Bump all version numbers again after cherry-picking unipackage fix 2014-10-01 17:06:57 -07:00
Sashko Stubailo
0129c3f5ac Bump all of the version numbers again, to republish with the unipackage.json fix 2014-10-01 15:43:05 -07:00
Sashko Stubailo
166fe658d7 Bump minimongo version number 2014-10-01 15:34:00 -07:00
Sashko Stubailo
eecc272e4a Bump every single package version number due to a change in compilation 2014-09-29 23:44:50 -07:00
rzymek
b0e8968b81 fix: upsert $addToSet with $each field creation error 2014-09-29 14:10:20 -07:00
Emily Stark
833c6f5b4f Bump package versions for 0.9.2 2014-09-15 11:36:57 -07:00
Slava Kim
3decef135a Bump package versions 2014-09-05 17:55:37 -07:00
David Glasser
2bc2a8f210 Fix sort keys like "a.0.b". Fixes #2439. 2014-09-05 16:46:09 -07:00
Slava Kim
fc56f795d6 Bump versions of packages for the 0.9.2-rc0 2014-09-02 14:57:33 -07:00
Slava Kim
a6c4ed6e6e Merge branch 'release-0.9.1' into release-0.9.2
Conflicts:
	packages/autoupdate/package.js
	packages/meteor-tool/package.js
	packages/meteor/package.js
	scripts/admin/meteor-release-experimental.json
2014-09-02 13:49:21 -07:00
Avital Oliver
808c90e3db Bump rc versions on packages 2014-09-01 00:16:00 -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
87b13e1b5a Rename Mongo.Collection.Cursor -> Mongo.Cursor, Mongo.Collection.ObjectID -> Mongo.ObjectID 2014-08-29 10:29:01 -07:00
Sashko Stubailo
96952dda2b Rename Meteor.Collection -> Mongo.Collection 2014-08-29 10:11:21 -07:00
Matthew Arbesfeld
fca5c382d5 Merge branch 'release-0.9.1' into cordova-hcp
Conflicts:
	docs/client/api.html
	docs/client/api.js
	meteor
	packages/autoupdate/autoupdate_server.js
	packages/autoupdate/package.js
	packages/constraint-solver/package.js
	packages/less/package.js
	packages/meteor-tool/package.js
	packages/meteor/package.js
	packages/minimongo/package.js
	packages/mongo-livedata/package.js
	packages/oauth1/package.js
	packages/package-version-parser/package.js
	packages/spiderable/package.js
	packages/standard-app-packages/package.js
	packages/templating/package.js
	packages/test-in-console/package.js
	packages/webapp/package.js
	scripts/admin/meteor-release-experimental.json
	scripts/generate-dev-bundle.sh
	tools/uniload.js
2014-08-28 21:13:59 -07:00