NoSQL Storage Service - Sort, Sum and MapReduce

0 votes

 

Hi,
 
1. Will NoSQL can get sorted data in ascending or descending ?
 
If yes, how could we do ? Could give me a sample in Android, iOS and PHP, please.
 
 
2. Could we get summed data in NoSQL ?
 
If we have schema (studentName, email, score).
Could we get specific studentName who's total score ?
If yes, how could we do ? Could give me a sample in Android, iOS and PHP, please.
 
3. What things Map Reduce can do ? Sum ? Sort ? or others ?
If yes, how could we do ? Could give me a sample in Android, iOS and PHP, please.
 
Thank you !
asked Mar 11, 2014 in App42 Cloud API-BaaS by guo (110 points)
recategorized Mar 11, 2014 by guo

1 Answer

0 votes
 
Best answer

>>For JSON documents sorting (ascending or descending) visit. our Dev-center .

>> Yes you can sum of score based on studentName or there email like this.

String result = storageService.mapReduce("<DB Name>","<Collection Name>","function map(){ emit(this.email,this.score);}",
"function sum(email, score){ return Array.sum(score)}}");
 
>> Map-reduce is a data processing paradigm for condensing large volumes of data into useful aggregated results. 

 

answered Mar 11, 2014 by sshukla480 (407 points)
selected Mar 12, 2014 by guo
Hi,
Thanks for your reply !

MySQL has function Count, MAX, MIN and AVG, could NoSQL do this ?

MySQL has distinct, like(fuzzy matching) in query, could NoSQL do this ?


NoSQL can sort ascending/descending and sum of score based on custom field, so I think that NoSQL has function of leaderboard.
In this case, App42CloudAPI has independent service Leaderboard Service, will this service has some functions that we don't know ? Otherwise why there is this independent service.

Thank you !
MySQL has function Count, MAX, MIN and AVG, could NoSQL do this ?
MySQL has distinct, like(fuzzy matching) in query, could NoSQL do this ?

Yes, NoSQL can perform the above functions.

Could give a sample about functions above ?
Please
Leaderboard service is ready made service for displaying leaderboard and saving score. If you want to create your own service you can do this using Storage Service however in that case you have to do lots of business logic by your own using query and map reduce.
Thank you very much !
Could give a sample about NoSQL functions below ?

Count, MAX, MIN and AVG
distinct, like(fuzzy matching) in query

Which are those business logic we need to do by our own ?
We do not directly support MAX,MIN,AVG function in our query function. You can do this think by using our map-reduce.OR do some logic with our EQUALS and GREATER_THAN  query methods.
ex.
http://api.shephertz.com/tutorial/Querying-Your-App-Data/?index=query-appdata
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
...