@@ -1511,8 +1511,8 @@ describe('Shell API (integration)', function() {
1511
1511
expect ( await collection . countDocuments ( ) ) . to . equal ( 0 ) ;
1512
1512
await bulk . execute ( ) ;
1513
1513
} ) ;
1514
- it ( 'tojson returns correctly' , async ( ) => {
1515
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : size , nUpdateOps : 0 , nRemoveOps : 0 , nBatches : 1 } ) ;
1514
+ it ( 'toJSON returns correctly' , async ( ) => {
1515
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : size , nUpdateOps : 0 , nRemoveOps : 0 , nBatches : 1 } ) ;
1516
1516
} ) ;
1517
1517
it ( 'executes' , async ( ) => {
1518
1518
expect ( await collection . countDocuments ( ) ) . to . equal ( size ) ;
@@ -1537,8 +1537,8 @@ describe('Shell API (integration)', function() {
1537
1537
bulk . find ( { x : { $mod : [ 2 , 0 ] } } ) . remove ( ) ;
1538
1538
await bulk . execute ( ) ;
1539
1539
} ) ;
1540
- it ( 'tojson returns correctly' , async ( ) => {
1541
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 0 , nRemoveOps : 1 , nBatches : 1 } ) ;
1540
+ it ( 'toJSON returns correctly' , async ( ) => {
1541
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 0 , nRemoveOps : 1 , nBatches : 1 } ) ;
1542
1542
} ) ;
1543
1543
it ( 'executes' , async ( ) => {
1544
1544
expect ( await collection . countDocuments ( ) ) . to . equal ( size / 2 ) ;
@@ -1562,8 +1562,8 @@ describe('Shell API (integration)', function() {
1562
1562
bulk . find ( { x : { $mod : [ 2 , 0 ] } } ) . removeOne ( ) ;
1563
1563
await bulk . execute ( ) ;
1564
1564
} ) ;
1565
- it ( 'tojson returns correctly' , async ( ) => {
1566
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 0 , nRemoveOps : 1 , nBatches : 1 } ) ;
1565
+ it ( 'toJSON returns correctly' , async ( ) => {
1566
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 0 , nRemoveOps : 1 , nBatches : 1 } ) ;
1567
1567
} ) ;
1568
1568
it ( 'executes' , async ( ) => {
1569
1569
expect ( await collection . countDocuments ( ) ) . to . equal ( size - 1 ) ;
@@ -1587,8 +1587,8 @@ describe('Shell API (integration)', function() {
1587
1587
bulk . find ( { x : 2 } ) . replaceOne ( { x : 1 } ) ;
1588
1588
await bulk . execute ( ) ;
1589
1589
} ) ;
1590
- it ( 'tojson returns correctly' , async ( ) => {
1591
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1590
+ it ( 'toJSON returns correctly' , async ( ) => {
1591
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1592
1592
} ) ;
1593
1593
it ( 'executes' , async ( ) => {
1594
1594
expect ( await collection . countDocuments ( { x : 1 } ) ) . to . equal ( 2 ) ;
@@ -1614,8 +1614,8 @@ describe('Shell API (integration)', function() {
1614
1614
bulk . find ( { x : 2 } ) . updateOne ( { $inc : { x : - 1 } } ) ;
1615
1615
await bulk . execute ( ) ;
1616
1616
} ) ;
1617
- it ( 'tojson returns correctly' , async ( ) => {
1618
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1617
+ it ( 'toJSON returns correctly' , async ( ) => {
1618
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1619
1619
} ) ;
1620
1620
it ( 'executes' , async ( ) => {
1621
1621
expect ( await collection . countDocuments ( { x : 1 } ) ) . to . equal ( 2 ) ;
@@ -1641,8 +1641,8 @@ describe('Shell API (integration)', function() {
1641
1641
bulk . find ( { x : { $mod : [ 2 , 0 ] } } ) . update ( { $inc : { x : 1 } } ) ;
1642
1642
await bulk . execute ( ) ;
1643
1643
} ) ;
1644
- it ( 'tojson returns correctly' , async ( ) => {
1645
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1644
+ it ( 'toJSON returns correctly' , async ( ) => {
1645
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1646
1646
} ) ;
1647
1647
it ( 'executes' , async ( ) => {
1648
1648
expect ( await collection . countDocuments ( ) ) . to . equal ( size ) ;
@@ -1671,8 +1671,8 @@ describe('Shell API (integration)', function() {
1671
1671
afterEach ( async ( ) => {
1672
1672
await collection . drop ( ) ;
1673
1673
} ) ;
1674
- it ( 'tojson returns correctly' , async ( ) => {
1675
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1674
+ it ( 'toJSON returns correctly' , async ( ) => {
1675
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1676
1676
} ) ;
1677
1677
it ( 'executes' , async ( ) => {
1678
1678
expect ( await collection . countDocuments ( ) ) . to . equal ( size + 1 ) ;
@@ -1698,8 +1698,8 @@ describe('Shell API (integration)', function() {
1698
1698
bulk . find ( { y : 0 } ) . upsert ( ) . updateOne ( { $set : { y : 1 } } ) ;
1699
1699
await bulk . execute ( ) ;
1700
1700
} ) ;
1701
- it ( 'tojson returns correctly' , async ( ) => {
1702
- expect ( bulk . tojson ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1701
+ it ( 'toJSON returns correctly' , async ( ) => {
1702
+ expect ( bulk . toJSON ( ) ) . to . deep . equal ( { nInsertOps : 0 , nUpdateOps : 1 , nRemoveOps : 0 , nBatches : 1 } ) ;
1703
1703
} ) ;
1704
1704
it ( 'executes' , async ( ) => {
1705
1705
expect ( await collection . countDocuments ( ) ) . to . equal ( size + 1 ) ;
@@ -1736,17 +1736,17 @@ describe('Shell API (integration)', function() {
1736
1736
for ( let i = 0 ; i < size ; i ++ ) {
1737
1737
bulk . insert ( { x : 1 } ) ;
1738
1738
}
1739
- expect ( bulk . tojson ( ) . nBatches ) . to . equal ( 1 ) ;
1739
+ expect ( bulk . toJSON ( ) . nBatches ) . to . equal ( 1 ) ;
1740
1740
bulk . find ( { x : 1 } ) . remove ( ) ;
1741
- expect ( bulk . tojson ( ) . nBatches ) . to . equal ( 2 ) ;
1741
+ expect ( bulk . toJSON ( ) . nBatches ) . to . equal ( 2 ) ;
1742
1742
bulk . find ( { x : 2 } ) . update ( { $inc : { x : 1 } } ) ;
1743
- expect ( bulk . tojson ( ) . nBatches ) . to . equal ( 3 ) ;
1743
+ expect ( bulk . toJSON ( ) . nBatches ) . to . equal ( 3 ) ;
1744
1744
for ( let i = 0 ; i < size ; i ++ ) {
1745
1745
bulk . insert ( { x : 1 } ) ;
1746
1746
}
1747
1747
} ) ;
1748
1748
it ( 'updates count depending on ordered or not' , ( ) => {
1749
- expect ( bulk . tojson ( ) . nBatches ) . to . equal ( m === 'initializeUnorderedBulkOp' ? 3 : 4 ) ;
1749
+ expect ( bulk . toJSON ( ) . nBatches ) . to . equal ( m === 'initializeUnorderedBulkOp' ? 3 : 4 ) ;
1750
1750
} ) ;
1751
1751
} ) ;
1752
1752
describe ( 'collation' , ( ) => {
@@ -1777,8 +1777,8 @@ describe('Shell API (integration)', function() {
1777
1777
// afterEach(async() => {
1778
1778
// await collection.drop();
1779
1779
// });
1780
- // it('tojson returns correctly', async() => {
1781
- // expect(bulk.tojson ()).to.deep.equal({ nInsertOps: 0, nUpdateOps: 1, nRemoveOps: 0, nBatches: 1 });
1780
+ // it('toJSON returns correctly', async() => {
1781
+ // expect(bulk.toJSON ()).to.deep.equal({ nInsertOps: 0, nUpdateOps: 1, nRemoveOps: 0, nBatches: 1 });
1782
1782
// });
1783
1783
// it('executes', async() => {
1784
1784
// expect(await collection.countDocuments()).to.equal(10);
0 commit comments