mirror of
https://github.com/parse-community/parse-server
synced 2026-08-09 13:03:18 +00:00
Page:
ExportAdapter.js
Pages
Auth.js
Config.js
DatabaseAdapter.js
Draft: Parse OTP
ExportAdapter.js
FileLoggerAdapter.js
FilesAdapter.js
GridStoreAdapter.js
Home
LoggerAdapter.js
PPNS Protocol Specification
Parse LiveQuery Protocol Specification
PromiseRouter.js
RestQuery.js
RestWrite.js
Running Parse Dashboard with HyperDev
Running Parse Server with HyperDev and mLab
Schema.js
analytics.js
batch.js
cache.js
classes.js
crypto.js
facebook.js
files.js
functions.js
index.js
installations.js
middlewares.js
push.js
rest.js
roles.js
sessions.js
testing routes.js
transform.js
triggers.js
users.js
Clone
1
ExportAdapter.js
Fosco Marotto edited this page 2016-01-28 12:34:54 -08:00
Table of Contents
ExportAdapter.js
DatabaseAdapter for MongoDB (default)
// Connects automatically
var db = new ExportAdapter('mongodb://...', { collectionPrefix: '' });
// Get the mongo collection object
db.collection('TestObject').then((collection) => { ... });
// Load a copy of the schema
db.loadSchema().then((schema) => { ... });
// Validate a REST API formatted object against the schema (can update the stored schema)
db.validateObject('TestObject', myObject).then(() => { ... });
// Transform a database object to REST API format
var obj = db.untransformObject(schema, isMaster, aclGroup, className, mongoObject);
// Update the database
db.update(className, query, update, options).then( ... );
// Handle relation operations, mutates the update
db.handleRelationUpdates(className, objectId, update).then( ... );
// Adds a relation
db.addRelation(key, fromClassName, fromId, toId).then( ... );
// Removes a relation
db.removeRelation(key, fromClassName, fromId, toId).then( ... );
// Delete objects matching the query
db.destroy(className, query, options).then( ... );
// Create an object
db.create(className, object, options).then( ... );
// Get related Ids given an owning Id
db.relatedIds(className, key, owningId).then( ... );
// Get owning Ids given a list of related Ids
db.owningIds(className, key, relatedIds).then( ... );
// Processes any $in constraints, mutates the query
db.reduceInRelation(className, query, schema).then( ... );
// Processes any $relatedTo constraints, mutates the query
db.reduceRelationKeys(className, query).then( ... );
// Does a find with "smart indexing"
// Currently just adds indexes for geo-point fields if not already set.
db.smartFind(collection, where, options).then( ... );
// Runs a find on the database
db.find(className, query, options).then( ... );