An Ember addon to interact with Parse datastore.
This supports Ember API v2.x and above (built using Ember v2.8)
Also we have full support for custom Parse URLs including back4app or sashido or your very own Parse installation on your own DO/AWS/GC/Azure box.
Install the addon
ember install ember-parse-lib
email@example.com via Bower as frontend dependency
bower install parse@^1.9.2
config/environment.js add this to your ENV.APP
var ENV =...APP:// Here you can pass flags/options to your application instance// when it is createdParse:url: ''appId: 'G9h2udnUz5z2oVT7OAFNNSkcQKkORl6Sb2bePZ7B'jsApiId: 'MaVeTMJ0uubSRBADREgXy9UY98uPcxDRMEurTiyf';
Create a model of your required class
ember g model fruit
You can make the model whichever way you want to, just like any simple Ember model
modelName (which is just the file name of the
model, all lowercase and dashified) of the model is
used as class name in Parse.
If you want to have a custom class name (for eg,
to have a capitalized name), reopen the class
Save the data as you'd do with any Ember model
To find all records in a class
To find a particular entity by given id
Here we are fetching fruit with id = 2D7dKQbCGZ.
ember-parse-lib supports query constraints too. For example to find fruits in ascending order of their colour -
And to find a particular username
An example structure of your query filter object is this -
equalTo:city: "Delhi"country: "India"notEqualTo:gender: "male"lessThan:age: 40lessThanOrEqualTo:hasCars: 4greaterThan:age: 20greaterThanOrEqualTo:kids: 1ascending : "age" "name"descending: "city"
This would find out people in Delhi, India, who are not males, between the age of 20 and 40, having less than 4 cars and more than 1 kid. It'll show up in ascending order of age, and within that, in order of name. Ties will be broken in descending order of city.
Signing up user
Sign up a user with username and password like this -
let user = thisstore;userusername = "username";userpassword = "password";user;
Logging in a user
Log in a user with username and password, or existing user object
let user = thisstore;userusername = username;userpassword = password;user;obj;obj;
Please read up on Ember's extending guidelines to get an idea of how Ember addons are structured.
- Visit your app at http://localhost:4200.
NOTE: I have not actually written any tests and writing tests for everything is something that needs to be done and is on high priority
ember try:eachto test your addon against multiple Ember versions)
ember test --server
For more information on using ember-cli, visit http://ember-cli.com/.