isite 2022.4.10 → 2022.4.15
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/lib/collection.js +11 -11
- package/object-options/index.js +1 -1
- package/package.json +1 -1
package/lib/collection.js
CHANGED
|
@@ -5,16 +5,15 @@ module.exports = function init(____0, option, db) {
|
|
|
5
5
|
$collection.busy = !_;
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
8
|
if (typeof option === 'string') {
|
|
11
9
|
option = {
|
|
12
|
-
collection
|
|
13
|
-
}
|
|
10
|
+
collection: option,
|
|
11
|
+
};
|
|
14
12
|
$collection.collection = option;
|
|
15
13
|
$collection.db = db || ____0.options.mongodb.db;
|
|
16
14
|
}
|
|
17
15
|
$collection.options = { ...____0.options.mongodb, ...option };
|
|
16
|
+
$collection.identityEnabled = $collection.options.identity.enabled;
|
|
18
17
|
|
|
19
18
|
$collection.db = $collection.options.db.trim().replace(' ', '');
|
|
20
19
|
$collection.collection = $collection.options.collection.trim().replace(' ', '');
|
|
@@ -83,7 +82,7 @@ module.exports = function init(____0, option, db) {
|
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
if ($doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
|
|
85
|
+
if ($collection.identityEnabled === !0 && $doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
|
|
87
86
|
____0.mongodb.collections_indexed[$collection.collection].nextID = $doc.id + 1;
|
|
88
87
|
}
|
|
89
88
|
|
|
@@ -396,7 +395,7 @@ module.exports = function init(____0, option, db) {
|
|
|
396
395
|
}
|
|
397
396
|
}
|
|
398
397
|
|
|
399
|
-
if ($doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
|
|
398
|
+
if ($collection.identityEnabled === !0 && $doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
|
|
400
399
|
____0.mongodb.collections_indexed[$collection.collection].nextID = $doc.id + 1;
|
|
401
400
|
}
|
|
402
401
|
});
|
|
@@ -532,7 +531,6 @@ module.exports = function init(____0, option, db) {
|
|
|
532
531
|
}
|
|
533
532
|
};
|
|
534
533
|
|
|
535
|
-
|
|
536
534
|
$collection.ObjectID = function (_id) {
|
|
537
535
|
return new ____0.mongodb.ObjectID(_id);
|
|
538
536
|
};
|
|
@@ -769,7 +767,7 @@ module.exports = function init(____0, option, db) {
|
|
|
769
767
|
|
|
770
768
|
// id Handle
|
|
771
769
|
|
|
772
|
-
if ($collection.
|
|
770
|
+
if ($collection.identityEnabled) {
|
|
773
771
|
$collection.aggregate(
|
|
774
772
|
[
|
|
775
773
|
{
|
|
@@ -819,7 +817,7 @@ module.exports = function init(____0, option, db) {
|
|
|
819
817
|
},
|
|
820
818
|
);
|
|
821
819
|
|
|
822
|
-
function
|
|
820
|
+
$collection.handleIndex = function () {
|
|
823
821
|
$collection.busy = !0;
|
|
824
822
|
$collection.identityEnabled = !0;
|
|
825
823
|
$collection.step = ____0.options.mongodb.identity.step;
|
|
@@ -854,9 +852,11 @@ module.exports = function init(____0, option, db) {
|
|
|
854
852
|
$collection.busy = !1;
|
|
855
853
|
},
|
|
856
854
|
);
|
|
857
|
-
}
|
|
855
|
+
};
|
|
858
856
|
|
|
859
|
-
handleIndex();
|
|
857
|
+
$collection.handleIndex();
|
|
858
|
+
} else {
|
|
859
|
+
____0.mongodb.collections_indexed[$collection.collection] = { nextID: 1 };
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
return $collection;
|
package/object-options/index.js
CHANGED