monastery 1.28.1 → 1.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/test/model.js +25 -26
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "monastery",
|
|
3
3
|
"description": "⛪ A straight forward MongoDB ODM built around Monk",
|
|
4
4
|
"author": "Ricky Boyce",
|
|
5
|
-
"version": "1.28.
|
|
5
|
+
"version": "1.28.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:boycce/monastery",
|
|
8
8
|
"homepage": "https://boycce.github.io/monastery/",
|
package/test/model.js
CHANGED
|
@@ -135,19 +135,18 @@ module.exports = function(monastery, opendb) {
|
|
|
135
135
|
let setupIndex2 = await userIndexRawModel._setupIndexes({
|
|
136
136
|
name: { type: 'string', index: 'text' },
|
|
137
137
|
})
|
|
138
|
-
await
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
])
|
|
138
|
+
let indexes = await db._db.collection('userIndexRaw').indexes()
|
|
139
|
+
expect(indexes[0]).toMatchObject({ v: 2, key: { _id: 1 }, name: '_id_' })
|
|
140
|
+
expect(indexes[1]).toMatchObject({ v: 2, unique: true, key: { email: 1 }, name: 'email_1' })
|
|
141
|
+
expect(indexes[2]).toMatchObject({
|
|
142
|
+
v: 2,
|
|
143
|
+
key: { _fts: 'text', _ftsx: 1 },
|
|
144
|
+
name: 'text',
|
|
145
|
+
weights: { name: 1 },
|
|
146
|
+
default_language: 'english',
|
|
147
|
+
language_override: 'language',
|
|
148
|
+
textIndexVersion: 3
|
|
149
|
+
})
|
|
151
150
|
|
|
152
151
|
// Unique & text index
|
|
153
152
|
let userIndexModel = await db.model('userIndex', {
|
|
@@ -157,19 +156,19 @@ module.exports = function(monastery, opendb) {
|
|
|
157
156
|
name: { type: 'string', index: 'text' },
|
|
158
157
|
}
|
|
159
158
|
})
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
159
|
+
|
|
160
|
+
let indexes2 = await db._db.collection('userIndex').indexes()
|
|
161
|
+
expect(indexes2[0]).toMatchObject({ v: 2, key: { _id: 1 }, name: '_id_' })
|
|
162
|
+
expect(indexes2[1]).toMatchObject({ v: 2, unique: true, key: { email: 1 }, name: 'email_1' })
|
|
163
|
+
expect(indexes2[2]).toMatchObject({
|
|
164
|
+
v: 2,
|
|
165
|
+
key: { _fts: 'text', _ftsx: 1 },
|
|
166
|
+
name: 'text',
|
|
167
|
+
weights: { name: 1 },
|
|
168
|
+
default_language: 'english',
|
|
169
|
+
language_override: 'language',
|
|
170
|
+
textIndexVersion: 3
|
|
171
|
+
})
|
|
173
172
|
|
|
174
173
|
// No text index change error, i.e. new Error("Index with name: text already exists with different options")
|
|
175
174
|
await expect(userIndexModel._setupIndexes({
|