Comments (5)
Thank you for your feedback. We use the issue tracker here to track valid bugs in our SDK. Your question seems to be more about how to use Parse. Could you check out the following resources?
- Documentation: https://www.parse.com/docs
- Google Groups: https://groups.google.com/forum/#!forum/parse-developers
- Stack Overflow: http://stackoverflow.com/tags/parse.com
from parse-sdk-js.
Hi @mik-dass, I don't have the context of the likes
and post
, but the following is my test code and it works fine
Android side
ParseObject parseuser=ParseObject.createWithoutData(ParseUser.class, "XXXX");
ParseObject object = new ParseObject("likes");
object.put("Owner", parseuser);
object.saveInBackground();
Cloudcode side
Parse.Cloud.useMasterKey();
var owner = request.object.get("Owner");
owner.fetch({
success: function(owner) {
owner.set('XX', 'XXX');
response.success();
},
error: function(error) {
response.error(error);
}
});
If this still does not work for you, do you get any exception from cloudcode side or android side?
from parse-sdk-js.
@wangmengyan95 Thank you for replying.So basically I should create a new column "owner" to store the id of the post owner. But will that be a good design as it will consist of redundant data ???
What I am trying to do is --
_User table
objectId / attribute
posts
objectId / authorId(pointer to _User)
likes
objectIId / likerId(pointer to _User who likes the post) / postId(ponter to the post liked)
In my cloud code I try to access the attribute of the user class pointed by the posts class.
So I create a _User object without data ,then created a posts object without data and set the authorId equal to the _User object created earlier.Then I created the likes object using the appropriate values and set the postId to the posts object created earlier.I thought this will help me to reduce a query since I did not wanted to fetch the post owner Id in the cloud code consuming a api call . But this approach failed and the cloud log showed me that the reponse object received the posts object as a pointer with no data in it .So am I missing something to be done to make my aprroach work??? Or should I do ahead and use one more api call to fetch the post owner Id??? Or create a new column in the likes class to store objectIds of the post owner??? Please reply.Thank you.
from parse-sdk-js.
Hi @mik-dass, we do not send the nested ParseObject's full data to cloud code. In order to get the data of the nested ParseObject, you have to do a query or fetch.
For the design issue, you can also take a look at here, we have a tutorial about how to implement relations in Parse. Hope it helps.
from parse-sdk-js.
Ok.Thank you .
from parse-sdk-js.
Related Issues (20)
- 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
- LocalDatastore tests fail HOT 4
- Parse.Installation doesn't handle deleted Installation objects on server HOT 3
- Replace dependency ip-node HOT 2
- Parse.File Terminates when Encoding/Decoding Large Media File(s) with URI Constructor HOT 6
- Change fields in LiveQueryClient.resubscribe to keys HOT 8
- Parse error in vite ( back4app ) on Parse.initialize: EventEmitter is not a constructor 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.