Skip to content

Commit 2b58cc2

Browse files
committed
Update guide for 2.3.0 and fix final tests
1 parent 30d1f9a commit 2b58cc2

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

2.3.0.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ If you are using MongoDB in Cluster or Replica Set mode, we recommend reading Mo
88
// Select the database that your Parse App uses
99
use parse;
1010

11-
// Select the collection your Parse App uses for users. For migrated apps, this probably include a collectionPrefix.
11+
// Select the collection your Parse App uses for users. For migrated apps, this probably includes a collectionPrefix.
1212
var coll = db['your_prefix:_User'];
1313

1414
// You can check if the indexes already exists by running coll.getIndexes()
1515
coll.getIndexes();
1616

1717
// The indexes you want should look like this. If they already exists, you can skip creating them.
18-
/*
1918
{
2019
"v" : 1,
2120
"unique" : true,
@@ -39,7 +38,6 @@ coll.getIndexes();
3938
"background" : true,
4039
"sparse" : true
4140
}
42-
*/
4341

4442
// Create the username index.
4543
// "background: true" is mandatory and avoids downtime while the index builds.
@@ -56,11 +54,11 @@ There are some issues you may run into during this process:
5654

5755
## Mongo complains that the index already exists, but with different options
5856

59-
In this case, you will need to create the unique index using a different index name, and/or remove the incorrect index. Avoid downtime or a temporary performance regression in your app by building the new index before removing the old one.
57+
In this case, you will need to remove the incorrect index. If your app relies on the existence of the index in order to be performant, you can create a new index, with "-1" for the direction of the field, so that it counts as a different options. Then, drop the conflicting index, and create the unique index.
6058

6159
## There is already non-unique data in the username or email field
6260

63-
This is possible if you have explicitly set some user's emails to null. These null emails can be removed with this command:
61+
This is possible if you have explicitly set some user's emails to null. If this is bogus data, and those null fields shoud be unset, you can unset the null emails with this command. If your app relies on the difference between null and unset emails, you will need to upgrade your app to treat null and unset emails the same before building the index and upgrading to Parse Server 2.3.0.
6462

6563
```js
6664
coll.update({ email: { $exists: true, $eq: null } }, { $unset: { email: '' } }, { multi: true })
@@ -69,7 +67,3 @@ coll.update({ email: { $exists: true, $eq: null } }, { $unset: { email: '' } },
6967
## There is already non-unique data in the username or email field, and it's not nulls
7068

7169
This is possible due to a race condition in previous versions of Parse Server. If you have this problem, it is unlikely that you have a lot of rows with duplicate data. We recommend you clean up the data manually, by removing or modifying the offending rows.
72-
73-
## My app depends on emails set to null behaving differently from emails set to undefined
74-
75-
You will need to update your app before executing the previous steps.

spec/ParseAPI.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ describe('miscellaneous', function() {
252252
return Parse.User.logIn('test', 'moon-y');
253253
}).then((user) => {
254254
expect(user.get('foo')).toEqual(2);
255-
Parse.User.logOut();
256-
done();
255+
Parse.User.logOut()
256+
.then(done);
257257
}, (error) => {
258258
fail(error);
259259
done();
@@ -371,8 +371,8 @@ describe('miscellaneous', function() {
371371
expect(results.length).toEqual(1);
372372
expect(results[0]['foo']).toEqual('bar');
373373
done();
374-
}).fail(err => {
375-
fail(err);
374+
}).fail(error => {
375+
fail(JSON.stringify(error));
376376
done();
377377
})
378378
});

src/testing-routes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function createApp(req, res) {
1414
var appId = cryptoUtils.randomHexString(32);
1515

1616
ParseServer({
17+
databaseURI: 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase',
1718
appId: appId,
1819
masterKey: 'master',
1920
serverURL: Parse.serverURL,

0 commit comments

Comments
 (0)