store.insert(instance).success(function (data) {
// Instance was inserted, and the updated data of instance is data (including the id)
}).error(function (error) {
// Could not insert instance
});
store.query(query, constraints).success(function (iterator) {
// Store was succesfully queried; the query result is an iterator over matched instances.
}).error(function (error) {
// Could not execute query
});
Modelling
var MyModel =BetaJS.Data.Modelling.Model.extend(null, {
}, function (inherited) {
return {
_initializeScheme:function () {
var scheme =inherited._initializeScheme.call(this);
scheme.first_name= {
type:"string"
};
scheme.last_name= {
type:"string"
};
return scheme;
}
};
});
var myTable =newBetaJS.Data.Modelling.Table(store, MyModel);
Query Collections
var tableQC =newBetaJS.Data.Collections.TableQueryCollection(table, query, options);
var storeQC =newBetaJS.Data.Collections.StoreQueryCollection(store, query, options);
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.