Browse Source

Notification problem with mongodb #780 (#782)

* some logs

* fix findOne

* fix

* fix

* fix2

* fix3
pull/1/head
Alexandr Velikiy 5 years ago committed by Alexey Velikiy
parent
commit
faa1780296
  1. 7
      server/src/services/data_layer/utils.ts

7
server/src/services/data_layer/utils.ts

@ -1,4 +1,4 @@
import { ObjectID } from 'mongodb';
import { FilterQuery, ObjectID } from 'mongodb';
//TODO: move to DbQueryWrapper
@ -9,10 +9,13 @@ export function wrapIdToQuery(query: string | object): object {
return query;
}
export function wrapIdToMongoDbQuery(query: string | object): object {
export function wrapIdToMongoDbQuery(query: FilterQuery<string | object>): object {
if(typeof query === 'string') {
return { _id: new ObjectID(query) };
}
if(typeof query._id === 'string') {
return { _id: new ObjectID(query._id) };
}
return query;
}

Loading…
Cancel
Save