As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
How to query to get data from multiple collections.
A
Anu Agarwal
started a topic
about 6 years ago
Hi, We have two collections Collection A, Collection B which contain related data. I want to have a single query through which I can retrieve data from both collections (all data or few necessary data). Is it possible?
Please let me know any link that could help about relational data handling. Sample would be appreciated.
Thank you in advance.
Best Answer
P
Pranav J
said
about 6 years ago
Anu,
We've been encouraging customers away from relational models when
possible as we're backed by Mongo which itself is non-relational.
Relational data support is deprecated at this point. If you need to do
references you can build your own in Business Logic https://devcenter.kinvey.com/android/guides/business-logic#
Kinvey is backed by Mongo which does not support relationships out of
the box. Instead, we encourage developers to denormalize their data.
Our scale makes it so it doesn't matter how many rows or columns you
store in each collection.
We've been encouraging customers away from relational models when
possible as we're backed by Mongo which itself is non-relational.
Relational data support is deprecated at this point. If you need to do
references you can build your own in Business Logic https://devcenter.kinvey.com/android/guides/business-logic#
Kinvey is backed by Mongo which does not support relationships out of
the box. Instead, we encourage developers to denormalize their data.
Our scale makes it so it doesn't matter how many rows or columns you
store in each collection.
I am using the approach you have suggested through Business Logic and created a collection hook on console with my two collections, but not getting how to request and get response in the android application.
Would you please tell me how to use collection hooks in Kinvey for Android?
But I still could not make out how we will send request body with the find() of the datastore and how we will get the data of both collections through response.
Suppose, I have written a business logic onPostFetch() collection hook on a collection 'employee' and it is getting executed fine on the console but how I can utilize this in our android code.
If I m trying to call a find() method on employee datastore from android code it gives empty list in onSuccess() method of callback.
Anu Agarwal
Hi,
We have two collections Collection A, Collection B which contain related data. I want to have a single query through which I can retrieve data from both collections (all data or few necessary data).
Is it possible?
Please let me know any link that could help about relational data handling. Sample would be appreciated.
Thank you in advance.
We've been encouraging customers away from relational models when possible as we're backed by Mongo which itself is non-relational. Relational data support is deprecated at this point. If you need to do references you can build your own in Business Logic https://devcenter.kinvey.com/android/guides/business-logic#
Kinvey is backed by Mongo which does not support relationships out of the box. Instead, we encourage developers to denormalize their data. Our scale makes it so it doesn't matter how many rows or columns you store in each collection.
Our engineering team put together an article to help folks understand how we think about data on NoSQL: https://devcenter.kinvey.com/android/guides/data-modeling# I'd recommend reading this.
Thanks,
Pranav
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPranav J
We've been encouraging customers away from relational models when possible as we're backed by Mongo which itself is non-relational. Relational data support is deprecated at this point. If you need to do references you can build your own in Business Logic https://devcenter.kinvey.com/android/guides/business-logic#
Kinvey is backed by Mongo which does not support relationships out of the box. Instead, we encourage developers to denormalize their data. Our scale makes it so it doesn't matter how many rows or columns you store in each collection.
Our engineering team put together an article to help folks understand how we think about data on NoSQL: https://devcenter.kinvey.com/android/guides/data-modeling# I'd recommend reading this.
Thanks,
Pranav
Anu Agarwal
Hi Pranav,
Thanks for your reply.
I am using the approach you have suggested through Business Logic and created a collection hook on console with my two collections, but not getting how to request and get response in the android application.
Would you please tell me how to use collection hooks in Kinvey for Android?
Pranav J
Please review https://devcenter.kinvey.com/android/guides/business-logic#invoking-hooks.
Thanks,
Pranav
Anu Agarwal
Thanks Pranav for the info.
But I still could not make out how we will send request body with the find() of the datastore and how we will get the data of both collections through response.
Suppose, I have written a business logic onPostFetch() collection hook on a collection 'employee' and it is getting executed fine on the console but how I can utilize this in our android code.
If I m trying to call a find() method on employee datastore from android code it gives empty list in onSuccess() method of callback.
Android code:
DataStore empDataStore = DataStore.collection("employee",Employee.class, StoreType.SYNC,mKinveyClient);
Pranav J
Looks like you are not constructing the query on client side. Please take a look at 'fetch multiple entities using a query' on this link.
Also, provide me with the query that you tried on API console for which you are getting business logic output successfully.
Thanks,
Pranav
-
Can I add KinveyReferences and other custom Arrays to the User entity?
-
How can I use custom enums within my Entity?
-
Linking an image does not save with LinkedData
-
How can I get all records saved by the current user?
-
Why don't all users see the same data when querying?
-
Retrieving related file from datastore collection - continued
-
Problem implementing sign up / login
-
Can Android API be used for Java?
-
I'm not receiving push notifications
-
It is impossible to receive object according to the link
See all 259 topics