@sprucelabs/data-stores 28.1.9 → 28.1.11
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.
|
@@ -1474,7 +1474,7 @@ const databaseAssertUtil = {
|
|
|
1474
1474
|
try {
|
|
1475
1475
|
yield db.syncUniqueIndexes(this.collectionName, [
|
|
1476
1476
|
{
|
|
1477
|
-
fields: ['uniqueField', '
|
|
1477
|
+
fields: ['uniqueField', 'someField3'],
|
|
1478
1478
|
filter: {
|
|
1479
1479
|
uniqueField: { $exists: true },
|
|
1480
1480
|
},
|
|
@@ -1487,9 +1487,10 @@ const databaseAssertUtil = {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
try {
|
|
1489
1489
|
yield db.createOne(this.collectionName, {
|
|
1490
|
+
name: generateId(),
|
|
1490
1491
|
uniqueField: 'test',
|
|
1491
1492
|
slug: null,
|
|
1492
|
-
|
|
1493
|
+
someField3: 'test',
|
|
1493
1494
|
});
|
|
1494
1495
|
}
|
|
1495
1496
|
catch (err) {
|
|
@@ -1497,28 +1498,31 @@ const databaseAssertUtil = {
|
|
|
1497
1498
|
err.stack) !== null && _b !== void 0 ? _b : err.message);
|
|
1498
1499
|
}
|
|
1499
1500
|
yield assert.doesThrowAsync(() => db.createOne(this.collectionName, {
|
|
1501
|
+
name: generateId(),
|
|
1500
1502
|
uniqueField: 'test',
|
|
1501
1503
|
slug: null,
|
|
1502
|
-
|
|
1504
|
+
someField3: 'test',
|
|
1503
1505
|
}), undefined, `Creating a duplicate record with should throw an error.`);
|
|
1504
1506
|
yield db.createOne(this.collectionName, {
|
|
1507
|
+
name: generateId(),
|
|
1505
1508
|
slug: '555-000-0000',
|
|
1506
|
-
|
|
1509
|
+
someField3: 'test',
|
|
1507
1510
|
});
|
|
1508
1511
|
yield db.createOne(this.collectionName, {
|
|
1512
|
+
name: generateId(),
|
|
1509
1513
|
slug: '555-000-0001',
|
|
1510
|
-
|
|
1514
|
+
someField3: 'test',
|
|
1511
1515
|
});
|
|
1512
1516
|
try {
|
|
1513
1517
|
yield db.syncUniqueIndexes(this.collectionName, [
|
|
1514
1518
|
{
|
|
1515
|
-
fields: ['uniqueField', '
|
|
1519
|
+
fields: ['uniqueField', 'someField3'],
|
|
1516
1520
|
filter: {
|
|
1517
1521
|
uniqueField: { $exists: true },
|
|
1518
1522
|
},
|
|
1519
1523
|
},
|
|
1520
1524
|
{
|
|
1521
|
-
fields: ['slug', '
|
|
1525
|
+
fields: ['slug', 'someField3'],
|
|
1522
1526
|
filter: {
|
|
1523
1527
|
slug: { $exists: true, $type: 'string' },
|
|
1524
1528
|
},
|
|
@@ -1530,15 +1534,17 @@ const databaseAssertUtil = {
|
|
|
1530
1534
|
err.stack) !== null && _c !== void 0 ? _c : err.message);
|
|
1531
1535
|
}
|
|
1532
1536
|
yield db.createOne(this.collectionName, {
|
|
1537
|
+
name: generateId(),
|
|
1533
1538
|
uniqueField: 'test',
|
|
1534
1539
|
slug: null,
|
|
1535
|
-
|
|
1540
|
+
someField3: 'next',
|
|
1536
1541
|
});
|
|
1537
1542
|
try {
|
|
1538
1543
|
yield db.createOne(this.collectionName, {
|
|
1544
|
+
name: generateId(),
|
|
1539
1545
|
uniqueField: 'test2',
|
|
1540
1546
|
slug: null,
|
|
1541
|
-
|
|
1547
|
+
someField3: 'next',
|
|
1542
1548
|
});
|
|
1543
1549
|
}
|
|
1544
1550
|
catch (err) {
|
|
@@ -1349,7 +1349,7 @@ const databaseAssertUtil = {
|
|
|
1349
1349
|
try {
|
|
1350
1350
|
await db.syncUniqueIndexes(this.collectionName, [
|
|
1351
1351
|
{
|
|
1352
|
-
fields: ['uniqueField', '
|
|
1352
|
+
fields: ['uniqueField', 'someField3'],
|
|
1353
1353
|
filter: {
|
|
1354
1354
|
uniqueField: { $exists: true },
|
|
1355
1355
|
},
|
|
@@ -1362,9 +1362,10 @@ const databaseAssertUtil = {
|
|
|
1362
1362
|
}
|
|
1363
1363
|
try {
|
|
1364
1364
|
await db.createOne(this.collectionName, {
|
|
1365
|
+
name: (0, generateId_1.default)(),
|
|
1365
1366
|
uniqueField: 'test',
|
|
1366
1367
|
slug: null,
|
|
1367
|
-
|
|
1368
|
+
someField3: 'test',
|
|
1368
1369
|
});
|
|
1369
1370
|
}
|
|
1370
1371
|
catch (err) {
|
|
@@ -1372,28 +1373,31 @@ const databaseAssertUtil = {
|
|
|
1372
1373
|
err.stack) !== null && _b !== void 0 ? _b : err.message);
|
|
1373
1374
|
}
|
|
1374
1375
|
await test_utils_1.assert.doesThrowAsync(() => db.createOne(this.collectionName, {
|
|
1376
|
+
name: (0, generateId_1.default)(),
|
|
1375
1377
|
uniqueField: 'test',
|
|
1376
1378
|
slug: null,
|
|
1377
|
-
|
|
1379
|
+
someField3: 'test',
|
|
1378
1380
|
}), undefined, `Creating a duplicate record with should throw an error.`);
|
|
1379
1381
|
await db.createOne(this.collectionName, {
|
|
1382
|
+
name: (0, generateId_1.default)(),
|
|
1380
1383
|
slug: '555-000-0000',
|
|
1381
|
-
|
|
1384
|
+
someField3: 'test',
|
|
1382
1385
|
});
|
|
1383
1386
|
await db.createOne(this.collectionName, {
|
|
1387
|
+
name: (0, generateId_1.default)(),
|
|
1384
1388
|
slug: '555-000-0001',
|
|
1385
|
-
|
|
1389
|
+
someField3: 'test',
|
|
1386
1390
|
});
|
|
1387
1391
|
try {
|
|
1388
1392
|
await db.syncUniqueIndexes(this.collectionName, [
|
|
1389
1393
|
{
|
|
1390
|
-
fields: ['uniqueField', '
|
|
1394
|
+
fields: ['uniqueField', 'someField3'],
|
|
1391
1395
|
filter: {
|
|
1392
1396
|
uniqueField: { $exists: true },
|
|
1393
1397
|
},
|
|
1394
1398
|
},
|
|
1395
1399
|
{
|
|
1396
|
-
fields: ['slug', '
|
|
1400
|
+
fields: ['slug', 'someField3'],
|
|
1397
1401
|
filter: {
|
|
1398
1402
|
slug: { $exists: true, $type: 'string' },
|
|
1399
1403
|
},
|
|
@@ -1405,15 +1409,17 @@ const databaseAssertUtil = {
|
|
|
1405
1409
|
err.stack) !== null && _c !== void 0 ? _c : err.message);
|
|
1406
1410
|
}
|
|
1407
1411
|
await db.createOne(this.collectionName, {
|
|
1412
|
+
name: (0, generateId_1.default)(),
|
|
1408
1413
|
uniqueField: 'test',
|
|
1409
1414
|
slug: null,
|
|
1410
|
-
|
|
1415
|
+
someField3: 'next',
|
|
1411
1416
|
});
|
|
1412
1417
|
try {
|
|
1413
1418
|
await db.createOne(this.collectionName, {
|
|
1419
|
+
name: (0, generateId_1.default)(),
|
|
1414
1420
|
uniqueField: 'test2',
|
|
1415
1421
|
slug: null,
|
|
1416
|
-
|
|
1422
|
+
someField3: 'next',
|
|
1417
1423
|
});
|
|
1418
1424
|
}
|
|
1419
1425
|
catch (err) {
|