totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

How to connect nosql from another server? #726

Closed raultaufan closed 5 years ago

raultaufan commented 5 years ago
var DB = require('nosql');
var nosql = DB.load('http://IP Address or URL/test.nosql');

nosql.find().make(function(builder) {
    builder.callback(function(err, response, count) {
        console.log(response);
    });
});

I can connected nosql from another drive/folder. But I can't connect from another server / IP Address. How to connect nosql from another server?

Thanks...

petersirka commented 5 years ago

Hi @raultaufan, sorry for delay. Try this:

Make a script test.js:

require('total.js');

NOSQL('https://www.totaljs.com/test.nosql').find().fields('title', 'price').callback(console.log);

Run it:

$ node test.js
raultaufan commented 5 years ago

Thank you I have been able to connect total.js to Nosql on another server. you saved my time...

But, how to write (insert, modify, remove) nosql on another server? Using MongoDB?

petersirka commented 5 years ago

Yes, you need use MongoDB or PostgreSQL because NoSQL embedded database works only with local flat files like SQLite database.

raultaufan commented 5 years ago

Thank you Peter Sirka ....