Comments (8)
might be a bug over there, but why not using a simpler query like this one?
var Community = Parse.Object.extends('Community');
var joinCommunity = Community.createWithoutData('acMv7RpF1l');
new Parse.Query('_User')
.equalTo('joinCommunity', joinCommunity)
.find()
from parse-sdk-js.
We've used Relations for many-to-many relationship between User and Community objects. The query you suggested assumes many-to-one?
from parse-sdk-js.
i don't get it, you've presented a query for one to one relation, did i miss something?
if you want one to many, you can replace equalTo
with containedIn
. If you're taking about Parse.Relation
you gave a wrong query from the beginning.
from parse-sdk-js.
The query is not just for one-to-one, it can also work when "joinCommunity" attribute is a Relation. When the query is used on relation it returns "all User objects where joinCommunity matches objects returned by the inner query".
The reason why this is a bug is because the same code works on v1.5.0 and not v1.6.2 without modifying a line of code.
from parse-sdk-js.
interesting and good to know. i didn't know you can make matchesQuery
on Parse.Relation
objects
from parse-sdk-js.
@jclalala can you provide a reproducible test case that succeeds on 1.5.0? I've created what I believe is an analogous setup, and running a query shaped like the one you linked to above fails on both old (1.3.5) and new (1.6.2) versions of the SDK. Are you sure the same code is running on 1.5.0?
from parse-sdk-js.
hi @andrewimm , please see below fiddlejs for case that has succeeded on v1.5.0.
https://jsfiddle.net/jclalala/x0owjbbs/9/
The same code that fails on v16.2:
https://jsfiddle.net/jclalala/x0owjbbs/
from parse-sdk-js.
Thanks @jclalala, that helped me pinpoint the issue.
You have found a bug, but it should not be a problem if you properly construct your query -- you should be calling new Parse.Query(Parse.User)
, not new Parse.Query('User')
. See the documentation: https://parse.com/docs/js/guide#users-querying
By default, the JS SDK should rewrite 'User'
to '_User'
, unless this behavior is turned off by the developer. While we enabled this feature for subclassing Parse.User in the new SDK, we neglected to do it on query construction as well, since all of our tests use the recommended new Parse.Query(Parse.User)
form. I'll make sure the rewrite flag is taken into account, and close this issue when it makes its way into master, but we probably won't release 1.6.5 for another week or so.
In the meantime, just avoid the issue by replacing 'User'
with either Parse.User
or '_User'
from parse-sdk-js.
Related Issues (20)
- Expand TypeScript support HOT 9
- Lock closed threads HOT 1
- saveEventually / EventuallyQueue doesn't work when killing server -> saveEventually object -> restarting server HOT 4
- API Reference Documentation not updated HOT 1
- SDK throws error in web contexts where calling into `window.indexedDB` is prohibited, but not undefined on the window HOT 2
- Calling `.add` multiple times on relations is broken HOT 4
- Refused to get unsafe header "access-control-expose-headers" on Chrome HOT 17
- Allow for REST Content Override for Server protection HOT 2
- Align currently supported Node.js version HOT 4
- `Parse.User.verifyPassword` does not pass request options to server HOT 5
- Parse SDK 4.3.1 is not working with React Native / Expo HOT 9
- Expo RN and ParseLiveQuery EventEmitter error HOT 13
- Cannot set ACL from JSON HOT 1
- Infinite loop in `encode.js` HOT 5
- Missing test for `Parse.User.verifyPassword` option `ignoreEmailVerification` HOT 2
- `Parse.Object.set` sliently handles validation errors HOT 1
- TypeError: attempted to use private field on non-instance, js engine: hermes HOT 3
- Installation support for JS SDK HOT 4
- Allow to run queries through LiveQueryClient (Parse Server issue #9086) HOT 5
- Local state of objects not correct if setting multiple properties HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-sdk-js.