How to use the parse.Query function in parse

To help you get started, we’ve selected a few parse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sphariab / Kerastase / app / components / NewQuestion.js View on Github external
getAnswers() {
        var _this = this;
        var hardCodedDataQuery,
            dynamicDataQuery;

        var objectIdsArray = ["VGF1UCoZU5", "oWlblkHGpC", "6TTHPSneQU",
            "cJBGsiHH1Y", "DNigZ6egMc", "r0IbnW3wp0", "asqvsXw4be", "ozSM3igXSx", "2QfVi8YVhM",
            "7RhOrbGGni", "ausAe1ZaIK", "WS2RGxVAKk", "aBeKdLM3E1", "VaP4llxFOs", "kGTNTx95ds"];

        hardCodedDataQuery = new Parse.Query(ParseQuestions),
            hardCodedDataQuery.containedIn("objectId", objectIdsArray);
        hardCodedDataQuery.ascending('positionSentence');
        hardCodedDataQuery.include('answers');

        dynamicDataQuery = new Parse.Query(ParseQuestions);
        dynamicDataQuery.notContainedIn("objectId", objectIdsArray);
        dynamicDataQuery.notEqualTo('type', 'pro');
        dynamicDataQuery.ascending('positionConsumer');
        dynamicDataQuery.include('answers.profiles');
        // dynamicDataQuery.include('answers.profiles.products');

        hardCodedDataQuery.find().then(
            (hardCodedQuestions) => {
                dynamicDataQuery.find().then(
                    (dynamicQuestions) => {
                        console.log('dynamicQuestions');
github xugy0926 / community-react-app / js / redux / actions.js View on Github external
UPDATE_LOADING,
  LOAD_POSTS,
  DELETE_PROJECT,
  UPDATE_PROJECT,
  LOAD_PROJECTS,
  INIT_NOTES,
  LOAD_NOTES,
  UPDATE_NOTE,
  DELETE_NOTE
} from './actionTypes'

const R = require('ramda')

// post
const Post = Parse.Object.extend('Post')
const postQuery = new Parse.Query(Post)
postQuery.limit(30)
postQuery.descending('createdAt')

// project
const Project = Parse.Object.extend('Project')
const projectQuery = new Parse.Query(Project)
projectQuery.limit(100)
projectQuery.descending('createdAt')

// note
const Note = Parse.Object.extend('Note')
const noteQuery = new Parse.Query(Note)
noteQuery.limit(100)
noteQuery.descending('createdAt')

export const signup = (username, email, password) => {
github sphariab / Kerastase / app / components / NewQuestion.js View on Github external
getAnswers() {
        var _this = this;
        var hardCodedDataQuery,
            dynamicDataQuery;

        var objectIdsArray = ["VGF1UCoZU5", "oWlblkHGpC", "6TTHPSneQU",
            "cJBGsiHH1Y", "DNigZ6egMc", "r0IbnW3wp0", "asqvsXw4be", "ozSM3igXSx", "2QfVi8YVhM",
            "7RhOrbGGni", "ausAe1ZaIK", "WS2RGxVAKk", "aBeKdLM3E1", "VaP4llxFOs", "kGTNTx95ds"];

        hardCodedDataQuery = new Parse.Query(ParseQuestions),
            hardCodedDataQuery.containedIn("objectId", objectIdsArray);
        hardCodedDataQuery.ascending('positionSentence');
        hardCodedDataQuery.include('answers');

        dynamicDataQuery = new Parse.Query(ParseQuestions);
        dynamicDataQuery.notContainedIn("objectId", objectIdsArray);
        dynamicDataQuery.notEqualTo('type', 'pro');
        dynamicDataQuery.ascending('positionConsumer');
        dynamicDataQuery.include('answers.profiles');
        // dynamicDataQuery.include('answers.profiles.products');

        hardCodedDataQuery.find().then(
            (hardCodedQuestions) => {
                dynamicDataQuery.find().then(
                    (dynamicQuestions) => {
                        console.log('dynamicQuestions');
                        var arr = _this.buildDataSource(hardCodedQuestions,dynamicQuestions);

                        _this.setState({
                            dataSource: arr
github ivnivnch / angular-parse / test / Parse.spec.js View on Github external
angular.mock.inject(function (_Parse_) {
        expect(_Parse_.ACL).toEqual(Parse.ACL);
        expect(_Parse_.Cloud).toEqual(Parse.Cloud);
        expect(_Parse_.Config).toEqual(Parse.Config);
        expect(_Parse_.Error).toEqual(Parse.Error);
        expect(_Parse_.FacebookUtils).toEqual(Parse.FacebookUtils);
        expect(_Parse_.File).toEqual(Parse.File);
        expect(_Parse_.GeoPoint).toEqual(Parse.GeoPoint);
        expect(_Parse_.Object).toEqual(Parse.Object);
        expect(_Parse_.Promise).toEqual(Parse.Promise);
        expect(_Parse_.Push).toEqual(Parse.Push);
        expect(_Parse_.Query).toEqual(Parse.Query);
        expect(_Parse_.Role).toEqual(Parse.Role);
        expect(_Parse_.Session).toEqual(Parse.Session);
        expect(_Parse_.User).toEqual(Parse.User);
      });
    });
github sphariab / Kerastase / app / components / Question4.js View on Github external
getAnswers(id, selectOption) {
        var _this = this;
        var query = new Parse.Query(ParseQuestions);
        query.equalTo('objectId', id);
        query.include('answers');
        query.first().then(
            (questions) => {
                this.state.questions.push(questions);
                this.state.questionTitles.push(questions.get("title"));
                var options = questions.get('answers'); 
                if (selectOption === 'first') {
                    _this.setState({
                        firstSelectOptions: options.map((option) => option.get('title'))
                    });
                }

                }, (error) => {
                    console.log('Error getting products');
                    console.log(error);
github xugy0926 / community-react-app / js / redux / actions.js View on Github external
export const loadPost = id => (dispatch, getState) => {
  const { posts } = getState().posts
  const post = R.find(R.propEq('id', id), posts)

  if (post) {
    return Promise.resolve(post)
  }

  const postQuery = new Parse.Query(Post)
  postQuery.equalTo('objectId', id)
  return postQuery.first()
}
github xugy0926 / community-react-app / js / Pages / Projects.js View on Github external
Row,
  Icon,
  Menu,
  Dropdown,
  Input,
  Modal,
  Form,
  List,
  message
} from 'antd'

import { currentUser, projects } from '../redux/selectors'
import { updateHeader, loadProjects, updateProject, deleteProject } from '../redux/actions'

const Plan = Parse.Object.extend('Plan')
const queryPlan = new Parse.Query(Plan)

class Projects extends React.Component {
  static propTypes = {
    boundUpdateHeader: PropTypes.func.isRequired,
    boundLoadProjects: PropTypes.func.isRequired,
    boundUpdateProject: PropTypes.func.isRequired,
    boundDeleteProject: PropTypes.func.isRequired,
    history: PropTypes.object.isRequired,
    currentUser: PropTypes.object.isRequired,
    projects: PropTypes.array.isRequired
  }

  constructor(props) {
    super(props)
    props.boundUpdateHeader({
      history: this.props.history,
github sphariab / Kerastase / app / components / Question9.js View on Github external
getAnswers(id, selectOption) {
        var _this = this;
        var query = new Parse.Query(ParseQuestions);
        query.equalTo('objectId', id);
        query.include('answers');
        query.first().then(
            (questions) => {
                var options = questions.get('answers'); 
                if (selectOption === 'first') {
                    _this.setState({
                        firstSelectOptions: options.map((option) => option.get('title'))
                    });
                }

                if (selectOption === 'second') {
                    _this.setState({
                        secondSelectOptions: options.map((option) => option.get('title'))
                    });
                }