About NoSQL query

0 votes

 

Hi,
About NoSQL, I have some question.
There is a field "Owner" in NoSQL,
if I login with userName, the content of this field is userName, 
if I login with emailId,  the content of this field is emailId,
if I open the function emailId login, and I login with userName, the content of this field is emailId.
 
1. Could field "Owner" to unify userName ?
※ All of Owner are the same => userName
Don't some are userName and some are emailId
 
Could NoSQL do this ?
 
2. Could we find custom field data with query in NoSQL ?
like MySQL query below :
 
SELECT Owner
FROM TableName
WHERE condition
 
3. If there are two table in NoSQL, could we query like MySQL below
 
SELECT ProductName
FROM TableA, TableB
WHERE TableA.Price > 50 AND TableB.Price <100
 
※ TableA and TableB are different table
 
Thank you !
asked Apr 8, 2014 in App42 Cloud API-BaaS by guo (110 points)
edited Apr 8, 2014 by guo

1 Answer

0 votes
 
Best answer

1. Could field "Owner" to unify userName ?

If you are not using ACL app, you have to just set App42API.setLoggedINUser(<USERNAME>) after login to have USERNAME as owner in all docs where USERNAME is username of your app user. If you want to have emailId as ownername, you have to do App42API.setLoggedINUser(<EMAIL>) where EMAIL is emailId of your app user.

 

2. Could we find custom field data with query in NoSQL ?

Yes you can very well do this, See tutorial here.

 

3. If there are two table in NoSQL, could we query like MySQL below

Query on two collections in single query is not supported yet. You have to first fetch target records from collection 1 and find those records in collection 2 using reference keys.

 

 

answered Apr 8, 2014 by ajay123 (899 points)
selected Apr 11, 2014 by guo
Hi,
Thanks for your help !

For question 1.
Could give me Android code, iOS code and PHP code ?

Thank you !
Could give me some help !
For iOS

[App42API setLoggedInUser:@"User Name"];

For Android

App42API.setLoggedInUser("USER_NAME");   

For PHP
App42API::setLoggedInUser($userName);
Thank you very much !
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...