@sprucelabs/data-stores 19.3.3 → 20.0.1
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/build/.spruce/errors/dataStores/indexNotFound.schema.js +6 -0
- package/build/.spruce/errors/errors.types.d.ts +7 -0
- package/build/databases/MongoDatabase.js +10 -6
- package/build/databases/NeDbDatabase.js +6 -2
- package/build/errors/SpruceError.js +3 -0
- package/build/errors/indexNotFound.builder.d.ts +4 -0
- package/build/errors/indexNotFound.builder.js +4 -0
- package/build/esm/.spruce/errors/errors.types.d.ts +7 -0
- package/build/esm/databases/MongoDatabase.js +10 -6
- package/build/esm/databases/NeDbDatabase.js +6 -2
- package/build/esm/errors/SpruceError.js +3 -0
- package/build/esm/errors/indexNotFound.builder.d.ts +4 -0
- package/build/esm/errors/indexNotFound.builder.js +4 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/tests/databaseAssertUtil.d.ts +74 -67
- package/build/esm/tests/databaseAssertUtil.js +620 -244
- package/build/esm/tests/pluckAssertionMethods.d.ts +1 -1
- package/build/esm/types/database.types.d.ts +6 -0
- package/build/esm/types/query.types.d.ts +5 -4
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/tests/databaseAssertUtil.d.ts +74 -67
- package/build/tests/databaseAssertUtil.js +599 -243
- package/build/tests/pluckAssertionMethods.d.ts +1 -1
- package/build/types/database.types.d.ts +6 -0
- package/build/types/query.types.d.ts +5 -4
- package/package.json +11 -11
|
@@ -14,6 +14,12 @@ const indexNotFoundSchema = {
|
|
|
14
14
|
isArray: true,
|
|
15
15
|
options: undefined
|
|
16
16
|
},
|
|
17
|
+
/** . */
|
|
18
|
+
'collectionName': {
|
|
19
|
+
type: 'text',
|
|
20
|
+
isRequired: true,
|
|
21
|
+
options: undefined
|
|
22
|
+
},
|
|
17
23
|
}
|
|
18
24
|
};
|
|
19
25
|
schema_1.SchemaRegistry.getInstance().trackSchema(indexNotFoundSchema);
|
|
@@ -236,6 +236,7 @@ export declare namespace SpruceErrors.DataStores {
|
|
|
236
236
|
interface IndexNotFound {
|
|
237
237
|
/** Missing Index. */
|
|
238
238
|
'missingIndex': string[];
|
|
239
|
+
'collectionName': string;
|
|
239
240
|
}
|
|
240
241
|
interface IndexNotFoundSchema extends SpruceSchema.Schema {
|
|
241
242
|
id: 'indexNotFound';
|
|
@@ -250,6 +251,12 @@ export declare namespace SpruceErrors.DataStores {
|
|
|
250
251
|
isArray: true;
|
|
251
252
|
options: undefined;
|
|
252
253
|
};
|
|
254
|
+
/** . */
|
|
255
|
+
'collectionName': {
|
|
256
|
+
type: 'text';
|
|
257
|
+
isRequired: true;
|
|
258
|
+
options: undefined;
|
|
259
|
+
};
|
|
253
260
|
};
|
|
254
261
|
}
|
|
255
262
|
type IndexNotFoundEntity = SchemaEntity<SpruceErrors.DataStores.IndexNotFoundSchema>;
|
|
@@ -244,7 +244,11 @@ class MongoDatabase {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
if (!found) {
|
|
247
|
-
throw new SpruceError_1.default({
|
|
247
|
+
throw new SpruceError_1.default({
|
|
248
|
+
code: 'INDEX_NOT_FOUND',
|
|
249
|
+
missingIndex: fields,
|
|
250
|
+
collectionName: collection,
|
|
251
|
+
});
|
|
248
252
|
}
|
|
249
253
|
}
|
|
250
254
|
async getUniqueIndexes(collection) {
|
|
@@ -282,7 +286,7 @@ class MongoDatabase {
|
|
|
282
286
|
}
|
|
283
287
|
async createIndex(collection, fields) {
|
|
284
288
|
const currentIndexes = await this.getIndexes(collection);
|
|
285
|
-
await this.assertIndexDoesNotExist(currentIndexes, fields);
|
|
289
|
+
await this.assertIndexDoesNotExist(currentIndexes, fields, collection);
|
|
286
290
|
const index = {};
|
|
287
291
|
fields.forEach((name) => {
|
|
288
292
|
index[name] = 1;
|
|
@@ -304,12 +308,12 @@ class MongoDatabase {
|
|
|
304
308
|
}
|
|
305
309
|
}
|
|
306
310
|
}
|
|
307
|
-
assertIndexDoesNotExist(currentIndexes, fields) {
|
|
311
|
+
assertIndexDoesNotExist(currentIndexes, fields, collectionName) {
|
|
308
312
|
if (this.doesIndexExist(currentIndexes, fields)) {
|
|
309
313
|
throw new SpruceError_1.default({
|
|
310
314
|
code: 'INDEX_EXISTS',
|
|
311
315
|
index: fields,
|
|
312
|
-
collectionName
|
|
316
|
+
collectionName,
|
|
313
317
|
});
|
|
314
318
|
}
|
|
315
319
|
}
|
|
@@ -335,7 +339,7 @@ class MongoDatabase {
|
|
|
335
339
|
}
|
|
336
340
|
async createUniqueIndex(collection, fields) {
|
|
337
341
|
const currentIndexes = await this.getUniqueIndexes(collection);
|
|
338
|
-
await this.assertIndexDoesNotExist(currentIndexes, fields);
|
|
342
|
+
await this.assertIndexDoesNotExist(currentIndexes, fields, collection);
|
|
339
343
|
const index = {};
|
|
340
344
|
fields.forEach((name) => {
|
|
341
345
|
index[name] = 1;
|
|
@@ -388,7 +392,7 @@ class MongoDatabase {
|
|
|
388
392
|
throw new SpruceError_1.default({
|
|
389
393
|
code: 'RECORD_NOT_FOUND',
|
|
390
394
|
storeName: 'MongoDatabase',
|
|
391
|
-
query
|
|
395
|
+
query,
|
|
392
396
|
});
|
|
393
397
|
}
|
|
394
398
|
return this.normalizeRecord(results.value);
|
|
@@ -232,7 +232,7 @@ class NeDbDatabase extends AbstractMutexer_1.default {
|
|
|
232
232
|
reject(new SpruceError_1.default({
|
|
233
233
|
code: 'RECORD_NOT_FOUND',
|
|
234
234
|
storeName: 'NeDatabase',
|
|
235
|
-
query
|
|
235
|
+
query,
|
|
236
236
|
}));
|
|
237
237
|
}
|
|
238
238
|
else {
|
|
@@ -348,7 +348,11 @@ class NeDbDatabase extends AbstractMutexer_1.default {
|
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
throw new SpruceError_1.default({
|
|
351
|
+
throw new SpruceError_1.default({
|
|
352
|
+
code: 'INDEX_NOT_FOUND',
|
|
353
|
+
missingIndex: fields,
|
|
354
|
+
collectionName: 'test_collection',
|
|
355
|
+
});
|
|
352
356
|
}
|
|
353
357
|
assertIndexDoesNotExist(currentIndexes, fields, collectionName) {
|
|
354
358
|
if (this.doesIndexExist(currentIndexes, fields)) {
|
|
@@ -59,6 +59,9 @@ class SpruceError extends error_1.default {
|
|
|
59
59
|
break;
|
|
60
60
|
case 'INVALID_DB_CONNECTION_STRING':
|
|
61
61
|
message = 'The database connection string you sent is no good!';
|
|
62
|
+
if (options.originalError) {
|
|
63
|
+
message += '\n\nOriginal error:\n\n' + options.originalError.message;
|
|
64
|
+
}
|
|
62
65
|
break;
|
|
63
66
|
case 'UNKNOWN_DATABASE_ERROR':
|
|
64
67
|
message = `Something went wrong with the database, the message is:\n\n"${options.databaseErrorMessage}"`;
|
|
@@ -236,6 +236,7 @@ export declare namespace SpruceErrors.DataStores {
|
|
|
236
236
|
interface IndexNotFound {
|
|
237
237
|
/** Missing Index. */
|
|
238
238
|
'missingIndex': string[];
|
|
239
|
+
'collectionName': string;
|
|
239
240
|
}
|
|
240
241
|
interface IndexNotFoundSchema extends SpruceSchema.Schema {
|
|
241
242
|
id: 'indexNotFound';
|
|
@@ -250,6 +251,12 @@ export declare namespace SpruceErrors.DataStores {
|
|
|
250
251
|
isArray: true;
|
|
251
252
|
options: undefined;
|
|
252
253
|
};
|
|
254
|
+
/** . */
|
|
255
|
+
'collectionName': {
|
|
256
|
+
type: 'text';
|
|
257
|
+
isRequired: true;
|
|
258
|
+
options: undefined;
|
|
259
|
+
};
|
|
253
260
|
};
|
|
254
261
|
}
|
|
255
262
|
type IndexNotFoundEntity = SchemaEntity<SpruceErrors.DataStores.IndexNotFoundSchema>;
|
|
@@ -270,7 +270,11 @@ export default class MongoDatabase {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
if (!found) {
|
|
273
|
-
throw new SpruceError({
|
|
273
|
+
throw new SpruceError({
|
|
274
|
+
code: 'INDEX_NOT_FOUND',
|
|
275
|
+
missingIndex: fields,
|
|
276
|
+
collectionName: collection,
|
|
277
|
+
});
|
|
274
278
|
}
|
|
275
279
|
});
|
|
276
280
|
}
|
|
@@ -314,7 +318,7 @@ export default class MongoDatabase {
|
|
|
314
318
|
createIndex(collection, fields) {
|
|
315
319
|
return __awaiter(this, void 0, void 0, function* () {
|
|
316
320
|
const currentIndexes = yield this.getIndexes(collection);
|
|
317
|
-
yield this.assertIndexDoesNotExist(currentIndexes, fields);
|
|
321
|
+
yield this.assertIndexDoesNotExist(currentIndexes, fields, collection);
|
|
318
322
|
const index = {};
|
|
319
323
|
fields.forEach((name) => {
|
|
320
324
|
index[name] = 1;
|
|
@@ -337,12 +341,12 @@ export default class MongoDatabase {
|
|
|
337
341
|
}
|
|
338
342
|
});
|
|
339
343
|
}
|
|
340
|
-
assertIndexDoesNotExist(currentIndexes, fields) {
|
|
344
|
+
assertIndexDoesNotExist(currentIndexes, fields, collectionName) {
|
|
341
345
|
if (this.doesIndexExist(currentIndexes, fields)) {
|
|
342
346
|
throw new SpruceError({
|
|
343
347
|
code: 'INDEX_EXISTS',
|
|
344
348
|
index: fields,
|
|
345
|
-
collectionName
|
|
349
|
+
collectionName,
|
|
346
350
|
});
|
|
347
351
|
}
|
|
348
352
|
}
|
|
@@ -371,7 +375,7 @@ export default class MongoDatabase {
|
|
|
371
375
|
createUniqueIndex(collection, fields) {
|
|
372
376
|
return __awaiter(this, void 0, void 0, function* () {
|
|
373
377
|
const currentIndexes = yield this.getUniqueIndexes(collection);
|
|
374
|
-
yield this.assertIndexDoesNotExist(currentIndexes, fields);
|
|
378
|
+
yield this.assertIndexDoesNotExist(currentIndexes, fields, collection);
|
|
375
379
|
const index = {};
|
|
376
380
|
fields.forEach((name) => {
|
|
377
381
|
index[name] = 1;
|
|
@@ -430,7 +434,7 @@ export default class MongoDatabase {
|
|
|
430
434
|
throw new SpruceError({
|
|
431
435
|
code: 'RECORD_NOT_FOUND',
|
|
432
436
|
storeName: 'MongoDatabase',
|
|
433
|
-
query
|
|
437
|
+
query,
|
|
434
438
|
});
|
|
435
439
|
}
|
|
436
440
|
return this.normalizeRecord(results.value);
|
|
@@ -261,7 +261,7 @@ export default class NeDbDatabase extends AbstractMutexer {
|
|
|
261
261
|
reject(new SpruceError({
|
|
262
262
|
code: 'RECORD_NOT_FOUND',
|
|
263
263
|
storeName: 'NeDatabase',
|
|
264
|
-
query
|
|
264
|
+
query,
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
@@ -389,7 +389,11 @@ export default class NeDbDatabase extends AbstractMutexer {
|
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
throw new SpruceError({
|
|
392
|
+
throw new SpruceError({
|
|
393
|
+
code: 'INDEX_NOT_FOUND',
|
|
394
|
+
missingIndex: fields,
|
|
395
|
+
collectionName: 'test_collection',
|
|
396
|
+
});
|
|
393
397
|
});
|
|
394
398
|
}
|
|
395
399
|
assertIndexDoesNotExist(currentIndexes, fields, collectionName) {
|
|
@@ -54,6 +54,9 @@ export default class SpruceError extends AbstractSpruceError {
|
|
|
54
54
|
break;
|
|
55
55
|
case 'INVALID_DB_CONNECTION_STRING':
|
|
56
56
|
message = 'The database connection string you sent is no good!';
|
|
57
|
+
if (options.originalError) {
|
|
58
|
+
message += '\n\nOriginal error:\n\n' + options.originalError.message;
|
|
59
|
+
}
|
|
57
60
|
break;
|
|
58
61
|
case 'UNKNOWN_DATABASE_ERROR':
|
|
59
62
|
message = `Something went wrong with the database, the message is:\n\n"${options.databaseErrorMessage}"`;
|
package/build/esm/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './types/database.types';
|
|
|
14
14
|
export * from './types/query.types';
|
|
15
15
|
export * from './types/stores.types';
|
|
16
16
|
export * from './constants';
|
|
17
|
+
export { default as DataStoresError } from './errors/SpruceError';
|
|
17
18
|
export { default as generateId } from './utilities/generateIdDeprecated';
|
|
18
19
|
export { default as CursorPager } from './cursors/CursorPager';
|
|
19
20
|
export * from './cursors/CursorPager';
|
package/build/esm/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from './types/database.types.js';
|
|
|
14
14
|
export * from './types/query.types.js';
|
|
15
15
|
export * from './types/stores.types.js';
|
|
16
16
|
export * from './constants.js';
|
|
17
|
+
export { default as DataStoresError } from './errors/SpruceError.js';
|
|
17
18
|
export { default as generateId } from './utilities/generateIdDeprecated.js';
|
|
18
19
|
export { default as CursorPager } from './cursors/CursorPager.js';
|
|
19
20
|
export * from './cursors/CursorPager.js';
|
|
@@ -1,75 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Database, Index, UniqueIndex } from '../types/database.types';
|
|
1
|
+
import { Database, Index, TestConnect, UniqueIndex } from '../types/database.types';
|
|
3
2
|
declare const databaseAssertUtil: {
|
|
4
3
|
collectionName: string;
|
|
5
|
-
runSuite(connect:
|
|
4
|
+
runSuite(connect: TestConnect, tests?: string[]): Promise<void>;
|
|
6
5
|
_getFilteredIndexes(db: Database): Promise<UniqueIndex[] | Index[]>;
|
|
7
6
|
_filterIdIndex(allIndexes: UniqueIndex[] | Index[]): UniqueIndex[] | Index[];
|
|
8
7
|
_assertUpdateUpdatedRightNumberOfRecords(db: Database, search: Record<string, any>, updates: Record<string, any>, expectedUpdateCount: number): Promise<void>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
generateIdDifferentEachTime(connect: TestConnect): Promise<void>;
|
|
9
|
+
assertCanSortDesc(connect: TestConnect): Promise<void>;
|
|
10
|
+
assertCanSortAsc(connect: TestConnect): Promise<void>;
|
|
11
|
+
assertInsertingGeneratesId(connect: TestConnect): Promise<void>;
|
|
12
|
+
assertThrowsWhenUpdatingRecordNotFound(connect: TestConnect): Promise<void>;
|
|
13
13
|
shutdown(db: Database): Promise<void>;
|
|
14
|
-
assertCanCreateUniqueIndex(connect:
|
|
15
|
-
assertHasNoUniqueIndexToStart(connect:
|
|
16
|
-
|
|
17
|
-
assertCanDeleteOne(connect:
|
|
18
|
-
assertCanDeleteRecord(connect:
|
|
19
|
-
assertCanLimitResultsToZero(connect:
|
|
20
|
-
assertCanLimitResults(connect:
|
|
21
|
-
assertFindOneOnEmptyDatabaseReturnsNull(connect:
|
|
22
|
-
assertEmptyDatabaseReturnsEmptyArray(connect:
|
|
23
|
-
assertCanPushOntoArrayValue(connect:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
14
|
+
assertCanCreateUniqueIndex(connect: TestConnect): Promise<void>;
|
|
15
|
+
assertHasNoUniqueIndexToStart(connect: TestConnect): Promise<void>;
|
|
16
|
+
assertCanUpsertOne(connect: TestConnect): Promise<void>;
|
|
17
|
+
assertCanDeleteOne(connect: TestConnect): Promise<void>;
|
|
18
|
+
assertCanDeleteRecord(connect: TestConnect): Promise<void>;
|
|
19
|
+
assertCanLimitResultsToZero(connect: TestConnect): Promise<void>;
|
|
20
|
+
assertCanLimitResults(connect: TestConnect): Promise<void>;
|
|
21
|
+
assertFindOneOnEmptyDatabaseReturnsNull(connect: TestConnect): Promise<void>;
|
|
22
|
+
assertEmptyDatabaseReturnsEmptyArray(connect: TestConnect): Promise<void>;
|
|
23
|
+
assertCanPushOntoArrayValue(connect: TestConnect): Promise<void>;
|
|
24
|
+
assertCanCreateWithObjectField(connect: TestConnect): Promise<void>;
|
|
25
|
+
canUpdateWithObjectField(connect: TestConnect): Promise<void>;
|
|
26
|
+
canUpdateFieldInObjectFieldWithTargettedWhere(connect: TestConnect): Promise<void>;
|
|
27
|
+
assertCanCreateMany(connect: TestConnect): Promise<void>;
|
|
28
|
+
assertCanUpdateMany(connect: TestConnect): Promise<void>;
|
|
29
|
+
assertCanQueryWithOr(connect: TestConnect): Promise<void>;
|
|
30
|
+
assertCanUpdate(connect: TestConnect): Promise<void>;
|
|
31
|
+
assertCanSortById(connect: TestConnect): Promise<void>;
|
|
32
|
+
assertCanCreateMultiFieldUniqueIndex(connect: TestConnect): Promise<void>;
|
|
33
|
+
assertSettingUniqueIndexViolationThrowsSpruceError(connect: TestConnect): Promise<void>;
|
|
34
|
+
assertDuplicateKeyThrowsOnInsert(connect: TestConnect): Promise<void>;
|
|
35
|
+
assertSyncingIndexesDoesNotAddAndRemove(connect: TestConnect): Promise<void>;
|
|
36
|
+
assertSyncingUniqueIndexesRemovesExtraIndexes(connect: TestConnect): Promise<void>;
|
|
37
|
+
assertSyncingUniqueIndexsSkipsExistingIndexs(connect: TestConnect): Promise<void>;
|
|
38
|
+
assertSyncingUniqueIndexsAddsMissingIndexes(connect: TestConnect): Promise<void>;
|
|
39
|
+
assertCantDropCompoundUniqueIndexThatDoesntExist(connect: TestConnect): Promise<void>;
|
|
40
|
+
assertCantDropIndexWhenNoIndexExists(connect: TestConnect): Promise<void>;
|
|
41
|
+
assertCantDropUniqueIndexThatDoesntExist(connect: TestConnect): Promise<void>;
|
|
42
|
+
assertCanDropCompoundUniqueIndex(connect: TestConnect): Promise<void>;
|
|
43
|
+
assertCanDropUniqueIndex(connect: TestConnect): Promise<void>;
|
|
44
|
+
assertCantCreateUniqueIndexTwice(connect: TestConnect): Promise<void>;
|
|
45
|
+
assertSyncingUniqueIndexesIsRaceProof(connect: TestConnect): Promise<void>;
|
|
46
|
+
assertUniqueIndexBlocksDuplicates(connect: TestConnect): Promise<void>;
|
|
47
|
+
assertCanCreateUniqueIndexOnNestedField(connect: TestConnect): Promise<void>;
|
|
48
|
+
assertCanPushToArrayOnUpsert(connect: TestConnect): Promise<void>;
|
|
49
|
+
assertCanSearchByRegex(connect: TestConnect): Promise<void>;
|
|
50
|
+
assertCanReturnOnlySelectFields(connect: TestConnect): Promise<void>;
|
|
51
|
+
assertThrowsWithBadDatabaseName(connect: TestConnect): Promise<void>;
|
|
52
|
+
assertThrowsWhenCantConnect(connect: TestConnect): Promise<void>;
|
|
53
|
+
assertThrowsWithInvalidConnectionString(connect: TestConnect): Promise<void>;
|
|
54
|
+
assertKnowsIfConnectionClosed(connect: TestConnect): Promise<void>;
|
|
55
|
+
assertCanQueryPathWithDotSyntax(connect: TestConnect): Promise<void>;
|
|
56
|
+
assertCanQueryByGtLtGteLte(connect: TestConnect): Promise<void>;
|
|
57
|
+
assertCanFindWithNe(connect: TestConnect): Promise<void>;
|
|
58
|
+
assertCanFindWithIn(connect: TestConnect): Promise<void>;
|
|
59
|
+
assertCanFindWithBooleanField(connect: TestConnect): Promise<void>;
|
|
60
|
+
assertCanCountOnId(connect: TestConnect): Promise<void>;
|
|
61
|
+
assertCanCount(connect: TestConnect): Promise<void>;
|
|
62
|
+
assertCanUpsertNull(connect: TestConnect): Promise<void>;
|
|
63
|
+
assertCanSaveAndGetNullAndUndefined(connect: TestConnect): Promise<void>;
|
|
64
|
+
assertSyncIndexesDoesNotRemoveExisting(connect: TestConnect): Promise<void>;
|
|
65
|
+
assertSyncIndexesRemovesExtraIndexes(connect: TestConnect): Promise<void>;
|
|
66
|
+
assertSyncIndexesSkipsExisting(connect: TestConnect): Promise<void>;
|
|
67
|
+
assertCantDropCompoundIndexThatDoesNotExist(connect: TestConnect): Promise<void>;
|
|
68
|
+
assertCanDropCompoundIndex(connect: TestConnect): Promise<void>;
|
|
69
|
+
assertCanDropIndex(connect: TestConnect): Promise<void>;
|
|
70
|
+
assertCanCreateMultiFieldIndex(connect: TestConnect): Promise<void>;
|
|
71
|
+
assertCantCreateSameIndexTwice(connect: TestConnect): Promise<void>;
|
|
72
|
+
assertCanCreateIndex(connect: TestConnect): Promise<void>;
|
|
73
|
+
assertHasNoIndexToStart(connect: TestConnect): Promise<void>;
|
|
74
|
+
assertNestedFieldIndexUpdates(connect: TestConnect): Promise<void>;
|
|
75
|
+
assertUpsertWithUniqueIndex(connect: TestConnect): Promise<void>;
|
|
76
|
+
assertSyncIndexesHandlesRaceConditions(connect: TestConnect): Promise<void>;
|
|
77
|
+
assertDuplicateFieldsWithMultipleUniqueIndexesWorkAsExpected(connect: TestConnect): Promise<void>;
|
|
78
|
+
_assertThrowsExpectedNotFoundOnUpdateOne(db: Database, query: Record<string, any>): Promise<void>;
|
|
79
|
+
_assert$orReturnsExpectedTotalRecords(db: Database, $or: Record<string, any>[], expected: number): Promise<void>;
|
|
80
|
+
_assertCanCreateMultiFieldIndex(connect: TestConnect, fields: string[]): Promise<void>;
|
|
74
81
|
};
|
|
75
82
|
export default databaseAssertUtil;
|