Giter VIP home page Giter VIP logo

Comments (8)

Irrelon avatar Irrelon commented on August 26, 2024

Hi ya,

Bit confused here... why don't you just send and receive JSON? Is there a specific case where you need to manipulate the .db files directly?

from forerunnerdb.

goel-sunny avatar goel-sunny commented on August 26, 2024

yes because i have a large data set in jSON format so for searching purpose and for loading performance i need data instant that can be possible via Database because if i do manipulation in JSON boject for searching , i did using recursion and check whether its have or not , if it have that store in array and not then move further check its children . this is for each entry in JSON this is time consuming and consuming so much memory so to avoid this i want to search in database .

from forerunnerdb.

Irrelon avatar Irrelon commented on August 26, 2024

Hey,

So my understanding from your message:

  1. You have a large data set
  2. You want to use ForerunnerDB because it makes it really easy to query that data set

I'm still a bit confused why you need to create / manipulate db files directly.

Surely you can do:

On the server: Get your data set and send it to the client in JSON format
On the client: Receive your data set in JSON and insert into ForerunnerDB and then query it

Can you explain a bit more what the issue you are trying to solve is? Thanks!

from forerunnerdb.

goel-sunny avatar goel-sunny commented on August 26, 2024

yes i have a large data set .

i am using Angular 4 primeNG treetable view in which i am sending JSON data object as a argument and it display to me ,

for small dataset its loading and searching is good but for large it fails so for that i am trying to send some data i.e on Demand from database .

but in my secenerio i have server which is native so it only create data in JSON file .json extension not in forerunner DB file standard .

so that JSON file i want to give to the database when client send me request for the data and manipulate according to his/her need .

after manipulation i want export that data to JSON file and pass to the server component.

so can i do import and export of JSON file in this data or not .

from forerunnerdb.

Irrelon avatar Irrelon commented on August 26, 2024

Yes you can import and export from ForerunnerDB in JSON format easily.

To import just create a collection and use insert() or setData().

To export, simply run a find query without any query object fields:

var myJson = collection.find({});
// Now send the myJson to the server or wherever.

from forerunnerdb.

goel-sunny avatar goel-sunny commented on August 26, 2024

or you can suggest me something for searching something in large nested JSON data set quickly .
i am using the following given approach , so you have any please suggest

filterFields(object) {
    let res = false;
        if (object.name) {
            let name = object.name;
            res = name.toLowerCase().includes(this.globalFilter.value.toString().toLowerCase())
        }
    return res;
}

filterChildren(children, parent) {
    let res = false;
    if (children) {
        children.map(child => {
            let _fields = this.filterFields(child.data);
            let _children = this.filterChildren(child.children, child);
            res = _fields || _children || res;
        });
        parent.expanded = res;
    }
    return res;
}


filter(node) {
        let res = false ;
        res=  this.filterFields(node.data) || this.filterChildren(node.children,node);
        return res;
    }

from forerunnerdb.

goel-sunny avatar goel-sunny commented on August 26, 2024

among searching via above solution or via forrunnerDB , which one is good option ?

from forerunnerdb.

goel-sunny avatar goel-sunny commented on August 26, 2024

I am using the below code for printing the JSON data on the console but nothing is happen , no error nothing.

just running the following code using node connection.js command

Connection.js file

I am doing so
`var ForerunnerDB = require("forerunnerdb");
var fdb = new ForerunnerDB();
var db = fdb.db("jardatabase");
var collection = db.collection("first");
collection.insert("./data.json");
// try with as well
//collection.insert("data.json");
console.log(" lets see any possiblites"+collection.find({}));

`

from forerunnerdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.