uranio 0.1.14 → 0.1.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/.uranio/package.json +1 -1
- package/.uranio/src/atom.ts +2 -2
- package/package.json +1 -1
package/.uranio/package.json
CHANGED
package/.uranio/src/atom.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import mongodb from 'mongodb';
|
|
7
|
+
import mongodb, {ObjectId} from 'mongodb';
|
|
8
8
|
|
|
9
9
|
import {atom, Query, Shape} from './types';
|
|
10
10
|
|
|
@@ -122,7 +122,7 @@ function _remove_id<A extends atom>(atom: Partial<A>): Shape<A> {
|
|
|
122
122
|
function _instance_object_id<A extends atom>(query: Query<A>): Query<A> {
|
|
123
123
|
for (let [key, value] of Object.entries(query)) {
|
|
124
124
|
if (key === '_id' && typeof value === 'string') {
|
|
125
|
-
query['_id'] = new
|
|
125
|
+
query['_id'] = new ObjectId(value) as any;
|
|
126
126
|
}
|
|
127
127
|
if (value && typeof value === 'object') {
|
|
128
128
|
value = _instance_object_id(value);
|