Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to add another schema id on mongodb

//first Schema
const user = new Schema({
	username:[type:String, unique:true]
})

//second Schema
const notes = new Schema({
	id : [{ type: Schema.Types.ObjectId, ref: 'user' }] // gets _id of first Schema(user)
  notes:[type:String, trim:true]
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: image not showing js 
Javascript :: javascript average function 
Javascript :: howt to disable a select tag using js 
Javascript :: navigation reset 
Javascript :: javascript map 2 array of objects 
Javascript :: how to print the value of variable in javascript in html 
Javascript :: component did mount in hooks 
Javascript :: jquery closest 
Javascript :: angular add object to array 
Javascript :: unpack list javascript 
Javascript :: (node:2496) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. 
Javascript :: run a loop inside a console.log no blank line 
Javascript :: angular keyup.enter 
Javascript :: get request react 
Javascript :: get document height js 
Javascript :: display current date and time in react js 
Javascript :: react native how to delete android build 
Javascript :: vuex-module-decorators access other state 
Javascript :: console.table javascript 
Javascript :: discord.js random message 
Javascript :: jquery disable button 
Javascript :: Custom jquery validation messages 
Javascript :: retour à la ligne react native 
Javascript :: image base64 to file javascript 
Javascript :: check if number is single digit javascript 
Javascript :: export variables react 
Javascript :: create an array of size n in javascript 
Javascript :: js keydown only once 
Javascript :: how to loop and add number in fuction for javascript 
Javascript :: js import export es5 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =