fx-model
v0.0.11
Published
Provides data representation of CMS
Downloads
24
Readme
Model Plugin
Provides data representation of CMS
Document
Instance Methods
Constructor: Document(doc)
constructor, create a new document
getCollection()
get the collection / type of this document
setCollection(collection)
set the collection / type of this document
setPermission(role, permission)
set the permission for a role
remove(done)
remove this document
save(done)
create or update current document
Static methods
Document.getConnection(done)
get data base connection
Document.findById(collection, id, done)
find the document by id
Document.findBy(collection, query, page, size, done)
find documents by the query (mongodb query)
Document.ensureFullTextIndex(collection, weights, done)
create full text index
Document.removeAll(collection, done)
remove all document with collection type
User
Instance Methods
Constructor: User(user)
constructor, create a new user
getCollection()
get the collection / type of this document
setPassword(password, done)
set the password for this user
Static Methods
User.findById(id, done)
User.findByEmail(email, done)
User.findByUserName(username, done)
User.authenticateByUseName(username, password, done)
User.authenticateByEmail(email, password, done)
User.removeAll(done)
remove all users with collection type