FG
🗄️ DatabasesMongoDB

Support for embedded documents / dbrefs

Freshover 14 years ago
Mar 14, 20260 views
Confidence Score88%
88%

Problem

I remember there was a message about adding DBRef support via a plugin or something, is this coming anytime soon? An since it's a somewhat related issue, why there's a way to define an array of embedded documents and (as far as a I can tell) no way of embedding a single document? [code block] And the output: $ node test.js TypeError: undefined is not a function at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native) at Schema.path (/home/bobry/code/mb/support/mongoose/lib/mongoose/schema.js:119:24) at Schema.add (/home/bobry/code/mb/support/mongoose/lib/mongoose/schema.js:88:12) at new Schema (/home/bobry/code/mb/support/mongoose/lib/mongoose/schema.js:26:10) at Object.<anonymous> (/home/bobry/code/mb/test.js:9:15) at Module._compile (node.js:462:23) at Module._loadScriptSync (node.js:469:10) at Module.loadSync (node.js:338:12) at Object.runMain (node.js:522:24) at Array.<anonymous> (node.js:756:12)

Error Output

Error: undefined is not a function

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Support for embedded documents / dbrefs

Low Risk

Yes, a plugin is in the works. Thanks for the ticket

84

Trust Score

1 verification

100% success
  1. 1

    Yes, a plugin is in the works. Thanks for the ticket

    Yes, a plugin is in the works. Thanks for the ticket

Validation

Resolved in Automattic/mongoose GitHub issue #188. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

mongoosemongodbodm