Skip to content
This repository was archived by the owner on Sep 5, 2022. It is now read-only.

Latest commit

 

History

History
14 lines (10 loc) · 370 Bytes

readme.md

File metadata and controls

14 lines (10 loc) · 370 Bytes

mongo

normMongoId$

Convert MongoDB id string to a MongoDB ObjectId.

import { of } from 'rxjs';
import normMongoId$ from '@xpr/operators/mongo/norm-mongo-id';

const plain = { _id: '61bb57b7b9476488e2767a2d', name: 'John' };

of(plain).pipe(normMongoId$()).subscribe(console.log);
// { _id: ObjectId('61bb57b7b9476488e2767a2d'), name: 'John' }