Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

define maxmum size of schema field in nodejs

db.createCollection("people", {
   validator: {
      $jsonSchema: {
         bsonType: "object",
         required: [ "name" ],
         properties: {
            name: {
               bsonType: ["string"],
               description: "must be a string"
            },
            friends: {
               bsonType: ["array"],
               items : { bsonType: ["string"] },
               minItems: 0,
               maxItems: 10,
               description: "must be a array of string and max is 10"
            }
         }
      }
   }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to toggle fa fa-caret-down and fa fa-caret-up using jquery 
Javascript :: how to manage logging using winston for production and development in node js "github" 
Javascript :: types for parameter destructuring 
Javascript :: reactjs navbar component 
Javascript :: upload and send file to axios multipart 
Javascript :: how to get data form 
Javascript :: ejs formatter vscode 
Javascript :: how to get css property of div after rendering in react js 
Javascript :: pass param to url retrofit 
Javascript :: jstl library 
Javascript :: arrays inside array of objects 
Javascript :: react hook form reset only one field 
Javascript :: angular retry interceptor 
Javascript :: get location from brwoser react 
Javascript :: discord.js make channel private 
Javascript :: playwright headless 
Javascript :: cypress wait object to change 
Javascript :: use queryselectro to select by form name 
Javascript :: how to get value in array object value using for loop in javascript 
Javascript :: function that duplicates data in array js 
Javascript :: axios react js 
Javascript :: Centos install update downgrade nodejs 
Javascript :: forever.js 
Javascript :: express get 
Javascript :: js get copied text 
Javascript :: export default 
Javascript :: The missing value javascript 
Javascript :: redux saga fetch data 
Javascript :: function to generate random number in javascript 
Javascript :: Using axios send a GET request to the address: 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =