Js database

What database would allow me to write in js code to query?

I’m not sure what you’re asking.

Javascript is frontend, it doesn’t talk to the database directly.

What of http://www.jsdb.org and http://www.taffydb.com ?

Yup, that looks like a couple random results when googling “javascript database”.

But unfortunately it does nothing to help answer the question.

JavaScript doesn’t talk directly with a database, nor can it really be or create a database. But with AJaX and a server-side scripting language, you can use js to contact a ss page that will connect to a database.

There are a number of database APIs available for use with JavaScript.

Note that JavaScript databases store their data on your visitor’s local computer. There are some that will then sync that with your server but not all do that.

Kind of depends on what you want to do but there are a few that I can think of that speak HTTP and could be queried directly from javascript and might even let you do some internal scripting with JS. They are:

  • ravendb (.NET document database, full JS client is in public release)
  • mongodb (document database, definitely can be used from javascript, see MEAN stack)
  • couchdb (document database, IIRC internally scriptable in JS, speaks HTTP, etc)
  • redis (technically not a database but it does speak HTTP IIRC)

You can also expose http friendly services using any server-side language (including js in node.js) and then expose that endpoint.

What do http have to do with database?

That is the protocol that a JavaScript database API running in the browser would use to pass the requests to the server in oder to update a database on the server.

I took your question to mean “what database can I query from javascript” as it isn’t entirely clear. In most implementations javascript runs in browsers which speak HTTP so you will need a database that speaks HTTP. The big exception here is node.js which is running server-side and has full blown database libraries that typically speak whatever the database speaks natively.

Many of those databases you’d code the actual query itself in json if you don’t do it via URI to boot.

Thanks for your replies.

The XML area is dead.