UNPKG

leaf-orient

Version:

OrientDB ODM with support for schemas inspired by mongoose

33 lines (26 loc) 741 B
import Connection from './connection'; import SchemaOrient from './schemas/orient'; import SchemaV from './schemas/orient/v'; import SchemaE from './schemas/orient/e'; import Model from './model'; import Type from './types/index'; import Orientjs from 'orientjs'; SchemaOrient.E = SchemaE; SchemaOrient.V = SchemaV; SchemaOrient.ObjectId = Type.Rid; //mongoose compatible Connection.Schema = SchemaOrient; Connection.Model = Model; Connection.Type = Type; Connection.Orientjs = Orientjs; class RawType { constructor(raw) { this._raw = raw; this.__orientose_raw__ = true; } toString() { return this._raw; } } Connection.RawType = RawType; Connection.raw = function(raw){ return new RawType(raw); }; export default Connection;