Client interface to access ejdb service. More...
Import Statement: | import QtEjdb 1.0 |
Since: | QtEjdb 1.0 |
import QtEjdb 1.0
QEjdbClient connects an ejdb. It is used for all communication with the QtEjdb backend.
QEjdbClient { id: client uri: 'file:test_db' }
An client can connect an ejdb with an uri or a connectionName. With a connectionName you can connect an previous opened connection.
// c++ QEjdbDatabase::addDatabase("file:test_db", "myconnection"); // qml QEjdbClient { id: client connectionName: 'myconnection' }
Open a database from an already opened QEjdbDatabase.
Open a database from uri.
QEjdbClient { id: client uri: 'file:test_db' }
Loads a bson with his id. If no bson found an empty json is returned.
Get an array with json from collection. Desciption about building queries and hints see http://ejdb.org/doc/ql/ql.html
Saves a bson in a given collection. The returned json have a _id property with a generated bson id.
function saveBson() { client.createCollection('person') var json = client.save('person', {name: 'Edgar Marx', age: 5}) console.log(json._id) var edgar = client.load('person', json._id) }