3.2.0 • Published 4 months ago

@parameter1/mongodb-dataloader v3.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

MongoDB Dataloader

Dataloaders for MongoDB collections - primarily for use in GraphQL servers (but other applications can apply). Supports document projection and foreign field control.

Installation

yarn add @parameter1/mongodb-dataloader

Usage

import { MongoDBDataLoader } from '@parameter1/mongodb-dataloader';
import { MongoClient } from '@parameter1/mongodb-core';

const client = new MongoClient('mongodb://some-server:27071');
const collection = client.db('test').collection('foo');

const loader = new MongoDBDataLoader({ name: 'foo', collection });

// load one by `_id`
await loader.load({ value: new ObjectId() });

// load many by `_id`
await loader.loadMany({ values: [new Object(), new ObjectId()] });
3.2.0

4 months ago

3.1.0

7 months ago

3.0.1

8 months ago

3.0.0

8 months ago

2.3.0

9 months ago

2.2.0

11 months ago

1.2.0

1 year ago

2.0.2

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.1

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago