0

I am not very clear on how to use node.js nosql with total.js (both are node.js modules).

  • How do I set up the backend database?
  • How do I programmatically create data from a custom/unessential js script, like a table that would serve for user accounts?
  • Where do I load nosql with total.js (where, maybe debug.js, am I adding code/what is the code)?
  • How can I display on a page view, for example, a username from that database (how do I access the data?)

No matter what your solution, please follow these instructions, or be sure to discuss any change:

  1. mkdir project_folder; cd project_folder
  2. npm init
  3. npm install --save nosql
  4. npm install --save total.js
  5. unzip and install empty_project.zip from total.js's download area on github, but do not overwrite files (npm has fresher files than are packaged and ready to go from github)
Community
  • 1
  • 1
roberto tomás
  • 4,435
  • 5
  • 42
  • 71

1 Answers1

1

total.js contains NoSQL embedded database (you don't have to install NoSQL). Basically you can use (and look into the /app/databases directory):

framework.database('users').insert({ alias: 'Peter' });
Peter Sirka
  • 748
  • 5
  • 10
  • thanks Mr. Sirka — to make sure: so even if I don't already have a "users" database, that will create the database for me .. and then later I can use I suppose a `framework.database('users').get({ alias: "Peter" }).first` or something to access the data for display? – roberto tomás Mar 18 '15 at 12:10
  • Yes, yes but here is a full documentation: https://github.com/petersirka/nosql ---> `F.database('users').` === `nosql.`. Thanks :-) – Peter Sirka Mar 18 '15 at 14:14
  • may I ask how should I do to code nosql in my app? I have code the simple web using totaljs. However, I confused where I should code nosql and how to configure the nosql code to my intire app code. – Agnes Palit Jun 18 '19 at 09:08