Skip to content

Instantly share code, notes, and snippets.

@mcat95
Created April 21, 2021 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcat95/f6dba9774a4c8e02edf169e1f2c12149 to your computer and use it in GitHub Desktop.
Save mcat95/f6dba9774a4c8e02edf169e1f2c12149 to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose');
const schema = mongoose.Schema({
field1: [mongoose.Schema({
field2: mongoose.Schema({
field3: Boolean,
}),
})],
});
console.log(schema.path('field1.field2.field3'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment