Database

A secure client library for MongoDB & MySQL API

Install

npm i @appstitch/database

Install peer dependencies

npm i @appstitch/core

Usage

API

Method

Type

Description

Platform

collection

Collection Name

Interchangeable with table

MongoDB & MySQL

table

Table Name

Interchangeable with collection

MongoDB & MySQL

id

ID, FieldName (Optional)

Set the ID for a specific document/record. FieldName is only required for MySQL

MongoDB & MySQL

where

Field, OperatorType, Value

A query object used to filter documents

MongoDB & MySQL

limit

number

Limits the number of documents. Default 50

MongoDB & MySQL

include

Field Array

Return specific fields.

MongoDB & MySQL

exclude

Field Array

Prevent specific fields from being returned

MongoDB & MySQL

startAfter

number

Skips the first n documents/records

MongoDB & MySQL

orderBy

Field, Direction

Specified order for results

MongoDB & MySQL

join

Source Field, Destination Table, Destination Field, JoinType

Used to combine rows from two or more tables

MySQL

Read Operations

Get by ID

circle-info

collection("users") and table("users") is interchangable and has the same effect. Appstitch offers a linguistic convention for both the NoSQL and SQL world

Get multiple documents

Write Operations

Insert

Update

Delete

Algolia Integration

Appstitch can be used to keep your Algoliaarrow-up-right indices in sync. Just pass syncData with any write operation.

circle-info

The Algolia index will need to have the identical name (and case) as your collection/table

Algolia example

Last updated