You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2.3.0.md
+3-9Lines changed: 3 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,13 @@ If you are using MongoDB in Cluster or Replica Set mode, we recommend reading Mo
8
8
// Select the database that your Parse App uses
9
9
use parse;
10
10
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.
12
12
var coll = db['your_prefix:_User'];
13
13
14
14
// You can check if the indexes already exists by running coll.getIndexes()
15
15
coll.getIndexes();
16
16
17
17
// The indexes you want should look like this. If they already exists, you can skip creating them.
18
-
/*
19
18
{
20
19
"v":1,
21
20
"unique":true,
@@ -39,7 +38,6 @@ coll.getIndexes();
39
38
"background":true,
40
39
"sparse":true
41
40
}
42
-
*/
43
41
44
42
// Create the username index.
45
43
// "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:
56
54
57
55
## Mongo complains that the index already exists, but with different options
58
56
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.
60
58
61
59
## There is already non-unique data in the username or email field
62
60
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.
## There is already non-unique data in the username or email field, and it's not nulls
70
68
71
69
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.
0 commit comments