Soap MongoDB
This page and the plugin itself are still in development, a lot will change.
Features
Installation
npm install @soapjs/soap-node-mongoUsage
import { MongoCollection, MongoConfig, MongoQueryFactory, MongoSource, MongoUtils } from '@soapjs/soap-node-mongo';const config = new MongoConfig({ database: 'yourDatabase', hosts: ['localhost'], ports: ['27017'], user: 'yourUser', password: 'yourPassword' // additional config parameters });const mongoSource = await MongoSource.create(config);const collection = new MongoCollection<MyDocumentType>( mongoSource, 'myCollectionName' ); const documents = await collection.find({ filter: { status: 'active' } });const queryFactory = new MongoQueryFactory(); const params = FindParams.create({ where: new Where().valueOf('customer').isEq(userId) }); const { filter, options } = queryFactory.createFindQuery(params);
Last updated