0.9.8 • Published 8 years ago

mongodb-native-join v0.9.8

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

mongodb-native-join

Join queries for mongodb native driver.

Easily join multiple queries into single query.

Support chain.

#API cursor(sourceCursor) - returns new wrapped cursor

join(field, collectionName) - query all fields from destination collection

join(field, collectionName, project) - query specified fields from destination collection

#Usage:

import joinedCursor from 'mongodb-native-join'
import {MongoClient} from 'mongodb'

const db = MongoClient.connect('your_server', (err, db) => {
	const cursor = joinedCursor(db.collection('som_collection').find('posts'));

	cursor
		.join('author', 'users', 'login firstName lastName')
		.join('comments', 'comments')
		.toArray();
	//do something    		
});
  
0.9.8

8 years ago

0.9.7

8 years ago

0.9.6-1

8 years ago

0.9.6

8 years ago

0.9.5

8 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago