Installations
npm install moleculer-db-adapter-mongoose
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>= 8.x.x
Node Version
16.20.2
NPM Version
lerna/4.0.0/node@v16.20.2+x64 (win32)
Score
68.3
Supply Chain
93.8
Quality
80.3
Maintenance
100
Vulnerability
98.9
License
Releases
moleculer-db@0.8.28
Updated on Feb 17, 2025
moleculer-db-adapter-mongoose@0.10.0
Updated on Jan 29, 2025
moleculer-db@0.8.26
Updated on Aug 24, 2024
moleculer-db@0.8.25
Updated on Nov 12, 2023
moleculer-db@0.8.24
Updated on Jul 15, 2023
moleculer-db-adapter-mongoose@0.9.3
Updated on Jul 15, 2023
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
Download Statistics
Total Downloads
793,089
Last Day
405
Last Week
1,914
Last Month
8,222
Last Year
95,775
GitHub Statistics
MIT License
154 Stars
595 Commits
121 Forks
9 Watchers
30 Branches
48 Contributors
Updated on Feb 17, 2025
Bundle Size
74.51 kB
Minified
26.03 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.10.0
Package Id
moleculer-db-adapter-mongoose@0.10.0
Unpacked Size
70.79 kB
Size
15.05 kB
File Count
19
NPM Version
lerna/4.0.0/node@v16.20.2+x64 (win32)
Node Version
16.20.2
Published on
Jan 29, 2025
Total Downloads
Cumulative downloads
Total Downloads
793,089
moleculer-db-adapter-mongoose 
Mongoose adapter for Moleculer DB service
Features
Install
1$ npm install moleculer-db moleculer-db-adapter-mongoose mongoose@6.5.4 --save
Usage
1"use strict"; 2 3const { ServiceBroker } = require("moleculer"); 4const DbService = require("moleculer-db"); 5const MongooseAdapter = require("moleculer-db-adapter-mongoose"); 6const mongoose = require("mongoose"); 7 8const broker = new ServiceBroker(); 9 10// Create a Mongoose service for `post` entities 11broker.createService({ 12 name: "posts", 13 mixins: [DbService], 14 adapter: new MongooseAdapter("mongodb://127.0.0.1/moleculer-demo"), 15 model: mongoose.model("Post", mongoose.Schema({ 16 title: { type: String }, 17 content: { type: String }, 18 votes: { type: Number, default: 0} 19 })) 20}); 21 22 23broker.start() 24// Create a new post 25.then(() => broker.call("posts.create", { 26 title: "My first post", 27 content: "Lorem ipsum...", 28 votes: 0 29})) 30 31// Get all posts 32.then(() => broker.call("posts.find").then(console.log));
Options
Example with connection URI
1new MongooseAdapter("mongodb://127.0.0.1/moleculer-db")
Example with URI and options
1new MongooseAdapter("mongodb://db-server-hostname/my-db", {
2 user: process.env.MONGO_USERNAME,
3 pass: process.env.MONGO_PASSWORD,
4 keepAlive: true
5})
Test
$ npm test
In development with watching
$ npm run ci
License
The project is available under the MIT license.
Contact
Copyright (c) 2016-2024 MoleculerJS

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
15 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 8/10 approved changesets -- score normalized to 8
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer-db/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer-db/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer-db/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer-db/ci.yml/master?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Reason
41 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8
- Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q
- Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38
- Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-8jmw-wjr8-2x66
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4
- Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653
- Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj
- Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67
- Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w
- Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2
- Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx
- Warn: Project is vulnerable to: GHSA-mqr2-w7wj-jjgr
- Warn: Project is vulnerable to: GHSA-49j4-86m8-q2jw
- Warn: Project is vulnerable to: GHSA-fpw7-j2hg-69v5
- Warn: Project is vulnerable to: GHSA-4rch-2fh8-94vw
- Warn: Project is vulnerable to: GHSA-pmh2-wpjm-fj45
- Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q
- Warn: Project is vulnerable to: GHSA-crh6-fp67-6883
Score
4.2
/10
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to moleculer-db-adapter-mongoose
@cylution/moleculer-db-adapter-mongoose
Mongoose adapter for Moleculer DB service
moleculer-db-adapter-mongoose-action
add create wih transaction function
tb-moleculer-db-adapter-mongoose
- `npm install mongoose --save` - `npm install tb-moleculer-db-adapter-mongoose --save`
moleculer-sf-mixin-db
> mongoose adapter for `moleculer-sf` > > export as plugin of [moleculer-sf](https://www.npmjs.com/package/moleculer-sf)