0.0.11 • Published 10 years ago

fx-model v0.0.11

Weekly downloads
33
License
-
Repository
-
Last release
10 years ago

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

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago