🍒
Cherry3
Support
  • 🥳Welcome
    • 📕Change Log
  • 🎗️Model & Schema
    • 🪡Usage & Options
  • 🍒Operators
    • 🧵find()
    • 🧵allRows()
    • 🧵findOne()
    • 🧵findOneAndUpdate()
    • 🧵findOneAndDelete()
    • 🧵findById()
    • 🧵findByIdAndUpdate()
    • 🧵findByIdAndDelete()
    • 🧵insertOne()
    • 🧵insertMany()
    • 🧵updateOne()
    • 🧵updateMany()
    • 🧵deleteOne()
    • 🧵deleteMany()
    • 🧵create() & save()
    • 🧵schemaInfo()
    • 🧵dropCollection()
    • 🧵renameCollection()
    • 🧵renameColumn()
    • 🧵deleteColumn()
    • 🧵distinct()
    • 🧵countDocuments()
    • 🧵inspect()
    • 🧵aggregate()
  • 🔧Other Operators
    • 🆙Update Operators
      • ⚡$set
      • ⚡$unset
      • ⚡$inc
      • ⚡$dec
      • ⚡$push
      • ⚡$pull
      • ⚡$pop
    • 📡Filter & Process Operators
      • ⚡$limit
      • ⚡$skip
      • ⚡$sort
      • ⚡$upsert
      • ⚡$multiPull
  • 🪝SQL Config File
Powered by GitBook
On this page

Was this helpful?

  1. Operators

schemaInfo()

Example

import { Model, Schema, Types } from 'cherry3';

const schema = Schema({
name: String,
surname: Types.String,
age: Types.Number,
classNumber: Number,
achievements: { type: Array, default: [] },
closeFriends: Object
});

const model = new Model('classList',schema)

(async() => {

var result = await model.schemaInfo();
console.log(result)
/*
{
name: [Function: String],
surname: "String",
age: "Number",
classNumber: [Function: Number],
achievements: { type: [Function: Array], default: [] },
closeFriends: [Function: Object]
}
*/

})();
Previouscreate() & save()NextdropCollection()

Last updated 1 year ago

Was this helpful?

🍒
🧵