Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
/ parse_rest_api Public archive

A Native Dart Parse API Client that provides functionality similar to CloudFirestore. Easily interact with the Parse REST API, including features such as creating documents and users with access restrictions, querying collections with filters and ordering, and retrieving results effortlessly

License

Notifications You must be signed in to change notification settings

jannikhst/parse_rest_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Native Dart Parse API Client

A CloudFirestore inspired Client for Parse REST API. Explore more features in the example file. https://parseplatform.org/

ACL and User

Create document and user and save it to parse with access restrictions:

import 'package:parse_rest_api/parse_rest_api.dart';

  //Initialize Parse
  Parse.initialize('https://MY.URL/parse', 'MY-APP-ID');
  //Create collection reference
  final myclass = CollectionReference('myclass');
  //register new user
  var user = await Parse.registerUser('Pete', 'pete!1234');
  //include current session token in header
  user.setTokenForParse();
  //create new acl object
  final acl = ParseACL();
  //deny public read & write requests
  acl.setPublic(false, false);
  //allow only user to read and write
  acl.addRights(user.id, true, true);
  //create document inside collection with the defined access restriction
  var doc = await myclass.add({
    'owner': 'Pete',
    'ACL': acl,
  });

Query collections

Create a query document and return result:

//create new query
  final query = CollectionReference('todos').query();
  //await returned documents
  final docs = await query
      //filter: where name is not 'Swim'
      .where('name', QueryFilter.notEqualTo('Swim'))
      //filter: where rank is greater than 1
      .where('rank', QueryFilter.greaterThanOrEqual(2))
      //order first by rank
      .orderBy('rank')
      //then order by name
      .orderBy('name')
      //return max 4 docs (default: 100)
      .limit(4)
      //get documents
      .get();

About

A Native Dart Parse API Client that provides functionality similar to CloudFirestore. Easily interact with the Parse REST API, including features such as creating documents and users with access restrictions, querying collections with filters and ordering, and retrieving results effortlessly

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages