Skip to content
Advertisement

How to create a schema to add several array into object Node/mongo db using post

this is the schema that I have now but I need to add more array as number 2, 3, 4

JavaScript

example:

JavaScript

//post api

JavaScript

Advertisement

Answer

Just try to create a schema with an empty object like:

Schema

JavaScript

so you can add multiple elements. But your data completely depends on what you are sending in your API request.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement