1.0.5 • Published 2 years ago

mplode v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Introduction

The purpose of this package is to simplify the use of the populate method in mongoose. The populate method is used to ensure any references in a document are resolved to actual documents.

Before

The Mongoose populate method is usually used like this

const documents = await interactions
	.find(args)
	.populate('user')
	.populate({ path: 'nft', populate: { path: 'wallet', populate: 'user' } })
	.lean()

After

With the use of this helper package this becomes:

import { expand } from 'mplode'

const documents = await interactions
	.find(args)
	.populate(expand('user'))
	.populate(expand('nft.wallet.user'))
	.lean()
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago