realm-orm
It is orm to work with realm data bases
How use
1- Define your model
import { Model } from "@alvilio/realm-orm/dist";
const Category = {
name: "Category",
properties: {
name: "string",
color: "string"
}
};
export default Model(Category);
2- Use methods
import { Category } from "myModels";
const category = {
name: "foo",
color: "red"
};
Category.instance()
.save(category)
.then(() => {
})
.catch(error => {
});
Methods
Model class
Name | Description | Params |
---|
delete | Delete one or more items | ids , string or string id array of items to delete |
findById | Find a model by id | id , string |
find | Find a model | filter , realm string filter |
save | Save or update a model, if model has id property then update else create | model , object value of the model |