Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Pike Module Reference:

module version 1.4, prepared

  MODULE Database
Modules
EJDB

  MODULE Database.EJDB
Classes
Collection
Database
LowCollection


Inherit ___EJDB

  • global.Database.___EJDB

  • Constant JBOREADER

    constant Database.EJDB.JBOREADER

    Description

    Create: Open as a reader.


    Constant JBOWRITER

    constant Database.EJDB.JBOWRITER

    Description

    Create: Open as a writer.


    Constant JBOCREAT

    constant Database.EJDB.JBOCREAT

    Description

    Create: Create if db file not exists.


    Constant JBOTRUNC

    constant Database.EJDB.JBOTRUNC

    Description

    Create: Truncate db on open.


    Constant JBONOLCK

    constant Database.EJDB.JBONOLCK

    Description

    Create: Open without locking.


    Constant JBOLCKNB

    constant Database.EJDB.JBOLCKNB

    Description

    Create: Lock without blocking.


    Constant JBOTSYNC

    constant Database.EJDB.JBOTSYNC

    Description

    Create: Synchronize every transaction.


    Constant JBIDXDROP

    constant Database.EJDB.JBIDXDROP

    Description

    Index: Drop index.


    Constant JBIDXDROPALL

    constant Database.EJDB.JBIDXDROPALL

    Description

    Index: Drop index for all types.


    Constant JBIDXOP

    constant Database.EJDB.JBIDXOP

    Description

    Index: Optimize index.


    Constant JBIDXREBLD

    constant Database.EJDB.JBIDXREBLD

    Description

    Index: Rebuild index.


    Constant JBIDXNUM

    constant Database.EJDB.JBIDXNUM

    Description

    Index: Number index.


    Constant JBIDXSTR

    constant Database.EJDB.JBIDXSTR

    Description

    Index: String index.


    Constant JBIDXARR

    constant Database.EJDB.JBIDXARR

    Description

    Index: Array token index.


    Constant JBIDXISTR

    constant Database.EJDB.JBIDXISTR

    Description

    Index: Case insensitive string index.


    Constant JBQURYCOUNT

    constant Database.EJDB.JBQURYCOUNT

    Description

    Query only count(*) in find()


    Constant JBJSONEXPORT

    constant Database.EJDB.JBJSONEXPORT

    Description

    Export data as JSON files instead exporting into BSONs.


    Constant JBIMPORTUPDATE

    constant Database.EJDB.JBIMPORTUPDATE

    Description

    Update existing collection entries with imported ones. Existing collections will not be recreated. For existing collections options will not be imported.


    Constant JBIMPORTREPLACE

    constant Database.EJDB.JBIMPORTREPLACE

    Description

    Recreate existing collections and replace all their data with imported entries. Collections options will be imported.

      CLASS Database.EJDB.Collection
    Methods
    delete()
    find()
    load()
    save()
    Description

    Object representing a collection of records stored in an EJDB databsase.


    Inherit LowCollection

  • LowCollection

  • Method save

    string|array(string) Database.EJDB.Collection()->save(mapping|array(mapping) obj, array(string)|string|void oid, int|void merge)

    Description

    Insert Documents into a collection.

    Parameter obj

    a document or array of documents to save.

    Parameter oid

    if specified, the object id (or array of object ids for multiple documents) of the document to save

    Parameter merge

    if an object id is specified, should the object be replaced or keys merged?

    Returns

    the object id or an array of object ids of documents saved.


    Method load

    mapping|array Database.EJDB.Collection()->load(string oid)

    Description

    Load a record from the current collection using the record's OID.


    Method delete

    int Database.EJDB.Collection()->delete(object(Standards.BSON.ObjectId) id)

    Description

    Remove a record from the current collection using the record's OID.


    Method find

    array(mapping|array) Database.EJDB.Collection()->find(mapping query, array(mapping) orqueries, mapping|void hints)

    Description

    Retrieve records from the current collection. For details of query syntax and query hints, please see the relevant EJDB documentation.

    Parameter query

    a mapping specifying the set of fields to match.

    Parameter orqueries

    an array of additional field sets to match in an or-fashion.

    Parameter hints

    mapping containing query hints.

      CLASS Database.EJDB.LowCollection
    Methods
    abort_transaction()
    begin_transaction()
    commit_transaction()
    delete()
    load_bson()
    low_find()
    save_bson()
    set_index()
    sync()
    transaction_status()

    Method delete

    int Database.EJDB.LowCollection()->delete(string oid)


    Method set_index

    int Database.EJDB.LowCollection()->set_index(string index, int flags)

    Description

    Set index for JSON field in EJDB collection.


    Method load_bson

    string Database.EJDB.LowCollection()->load_bson(string oid)


    Method save_bson

    string Database.EJDB.LowCollection()->save_bson(string bsonval, string|void oid, int|void merge)


    Method low_find

    array Database.EJDB.LowCollection()->low_find(string bson_query)


    Method begin_transaction

    int Database.EJDB.LowCollection()->begin_transaction()

    Description

    Begin transaction for EJDB collection.


    Method abort_transaction

    int Database.EJDB.LowCollection()->abort_transaction()

    Description

    Abort transaction for EJDB collection.


    Method commit_transaction

    int Database.EJDB.LowCollection()->commit_transaction()

    Description

    Commit transaction for EJDB collection.


    Method transaction_status

    int Database.EJDB.LowCollection()->transaction_status()

    Description

    Get current transaction status.


    Method sync

    int Database.EJDB.LowCollection()->sync()

    Description

    Synchronize content of a EJDB collection database with the file on device.

      CLASS Database.EJDB.Database
    Methods
    close()
    create()
    create_collection()
    delete_collections()
    get_collection()
    get_collections()
    is_open()
    low_command()
    sync()

    Method create

    void Database.EJDB.Database()->create(string dbpath, int flags)


    Method sync

    int Database.EJDB.Database()->sync()

    Description

    Synchronize entire EJDB database and all its collections with storage.


    Method is_open

    int Database.EJDB.Database()->is_open()


    Method close

    int Database.EJDB.Database()->close()


    Method delete_collections

    int Database.EJDB.Database()->delete_collections(string collection, int unlink)

    Description

    Removes collections specified by 'name'.


    Method get_collections

    array(string) Database.EJDB.Database()->get_collections()


    Method get_collection

    object Database.EJDB.Database()->get_collection(string name)


    Method create_collection

    object Database.EJDB.Database()->create_collection(string name, mapping|void opts)

    Parameter name

    name of the collection to create.

    Parameter opts

    large, compressed, records, cachedrecords


    Method low_command

    string Database.EJDB.Database()->low_command(string bson)

    gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University