EzDevInfo.com

ForerunnerDB

A JavaScript database with mongo-like query language, data-binding support, runs in the browser as a client-side DB or on the server via Node.js! Irrelon Software Limited

Where does ForerunnerDB save its Database?

I am about to write an HTML file which is supposed to run in the browser locally, create and modify a database (Forerunner DB) , and show some results.

I wrote the below , where should I find the database file ? is the below enough "once the page is loaded " to sse the DB or there is some "save" command ?

<!DOCTYPE html>
<meta charset="utf-8" />
<title>ouch</title>
<body>
<p id="out">Testing..</br> >
</body>
<script src="C:\Users\n17263\node_modules\forerunnerdb\js\dist\fdb-all.min.js" type="text/javascript"></script>
<script>
var db = new ForerunnerDB('db');
var Customers= db.collection('Customers');
var Suppliers= db.collection('Suppliers');
var Items= db.collection('Items');
var S_ITMES= db.collection('S_ITEMS');
var Purchase_Invoices= db.collection('Purchase_Invoices');
var Sales_Invoices= db.collection('Sales_Invoices');
var Orders= db.collection('Orders');
Customers.insert({name:'Mohammad'});

</script>

Source: (StackOverflow)

Determine if a Longitude & Latitude Co-ordinate is Inside a Radius in Miles and Kilometers

Using only pseudo-code or JavaScript, can anyone describe the best way to determine which items in array of objects composed of:

{
"lat": float,
"lng": float
}

are within a given radius in either miles or kilometers?

I am adding geo-location-based queries to ForerunnerDB (https://github.com/irrelon/ForerunnerDB) and would like to be able to produce fast results from the search.

Bonus points if you can describe an indexing strategy that will speed up the query over the array. I have written the ForerunnerDB database from the ground up so can be flexible with integrating the answer into the code, but the main concern is query performance.

While the question pertains to a new feature of ForerunnerDB, it does not require that you go and read that project's source or familiarise yourself with that system and a pseudo-code or stand-alone JS example would be very welcome!


Source: (StackOverflow)

Advertisements