I have three tables in the Database in Appery and I want to create a Service which should get data from all three tables in a single service.
Is it possible to create a Database View? Any other options.
I have three tables in the Database in Appery and I want to create a Service which should get data from all three tables in a single service.
Is it possible to create a Database View? Any other options.
Hi Anandraj,
You can do this if only these collections are connected by a pointer field, otherwise you would need to create 3 different services.
How to create a Pointer feilds. I have created a feilds in each tables and added a column and value which is same as from other table which needs to be mapped. If I can write a SQL with where clause then I can map these feilds and get the values.
Anandraj,
Here it the pointer: http://docs.appery.io/documentation/b...
Appery.io uses mongoDB that is not a noSQL Database.
Thank you. Here is my scenario.
Table1
_id Name ExpDate
1 AA 2014-02-10
2 BB 2014-03-12
Table2
_id FName Offer
10 CC 2
11 DD 3
12 EE 4
Table3
_id Table1Map Table2Map
100 1 10
101 1 11
102 2 10
103 2 12
I need to get values from all three table as shown below.
{ "Table1.Name": AA
{"Table2.FNAme" : CC,"Table2.Offer":2}
{"Table2.FName":DD,"Table2.Offer":3},
"Table1.NAme":BB
{"Table2.FNAme" : CC,"Table2.Offer":2}
{"Table2.FName":EE,"Table2.Offer":4}
}
Please help.
Hi Anandraj,
You should add a request parameter 'include' for Table3, and there specify names of Table1 and Table2. Please take a look at here: http://docs.appery.io/documentation/b...