Doo Dad
Posts: 0
Joined: Sun May 11, 2014 8:04 pm

Database Access through Javascript

Hi

I was trying to put together some queries on server side code but I cant fine any examples of accessing a database directly from JavaScript code.

Of course there are many examples using Curl ... but no examples showing how to make a query using JavaScript on the server side .

Example: How would I query the users database to select users who's username started with the letter 'A' for example ....

Select _id,username from users where Upper(username) like 'A%'

this is a very typical simple query ... can someone provide an example how how to do this i server code ?

That would be quite helpful.

Thanks
DD

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Database Access through Javascript

Hello,

Here you can find examples how to send request to Appery.io DB from servercode: http://docs.appery.io/tutorials/build...
to get user with name like "A...." you should specify where parameter:

code'where={"userName": {"$regex": "A"}}' /code

Here you can find more about DB queries: http://docs.appery.io/documentation/b...

Doo Dad
Posts: 0
Joined: Sun May 11, 2014 8:04 pm

Database Access through Javascript

Thanks !

Return to “Issues”