Skip to content

Example of SuperCamo usage in a NodeJS terminal application.

License

Notifications You must be signed in to change notification settings

BigfootDS/supercamo-example-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SuperCamo Example: Basic NodeJS Terminal App

Example of SuperCamo usage in a NodeJS terminal application.

Models

This example uses documents and embedded documents.

Model schema summaries as follows:

// User - Document
{
    "name":"String",
    "biography":"LocalizedContent subdocument"
}
// LocalizedContent - Subdocument
{
    "language":"String",
    "content":"String"
}
// Article - Document
{
    "title":["LocalizedContent subdocuments"],
    "content":["LocalizedContent subdocuments"],
    "authors":["User document references"]
}

The dependency of the models can be pictured like this:

graph TD
    A(Article) -- has reference to many --> B(User)
    A -- contains many --> C(LocalizedContent)
    B -- contains one --> C
Loading

Functionality

CREATE

  • Create documents via insertMany
  • Create documents via insertOne
  • Create documents that refer to other documents by ID
  • Create documents that use embedded documents

READ

  • Retrieve all documents in a specific collection as objects
  • Retrieve all documents in a specific collection as document instances
  • Retrieve all documents in all collections as objects
  • Retrieve all documents in all collections as objects, populating any referenced data
  • Retrieve all documents in all collections as document instances
  • Retrieve a specific document by specific query as an object
  • Retrieve a specific document by specific query as an object, populating any referenced data
  • Retrieve a specific document by specific query as a document instance

UPDATE

  • Update document primitive-typed data
  • Update a document's embedded document-typed data

DELETE

  • Delete all documents from all collections
  • Delete a specific document from a specific collection

About

Example of SuperCamo usage in a NodeJS terminal application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages