Questions tagged [forerunnerdb]

ForerunnerDB is a NoSQL database for browsers and Node.js and allows you to CRUD your data client-side with the same query language as MongoDB.

What Questions Should Have This Tag?

Questions that are directly related to ForerunnerDB should include this tag so that expert users of Forerunner can help answer your questions.

Introduction

ForerunnerDB allows you to create, read, update and delete JSON objects called documents that are stored in collections. Collections are like tables in traditional databases such as MySQL. Collections of documents can be queried using the same query language as MongoDB so those familiar with MongoDB will find it easy to get started with ForerunnerDB.

You can find out more about ForerunnerDB and read the full manual and documentation on the official site at http://www.forerunnerdb.com.

Tutorials

You can find tutorials on the official site at http://www.forerunnerdb.com including how to include ForerunnerDB on your web site and a full todo-list application in 39 lines of code.

Basic Usage

When you have ForerunnerDB loaded on your HTML page you can create a new database and store data in it immediately. To create a new database you use:

var fdb = new ForerunnerDB(),
    db = fdb.db('myDbName');

Collections are created automatically when requested so you can create or get a collection via:

var collection = db.collection('myCollectionName');

Storing documents (JSON objects) in Forerunner is very easy, simply insert the document like so:

collection.insert({ name: 'Jim', age: 15 });

Once you have documents in a collection you can query it like this:

var arrayOfJims = collection.find({ name: 'Jim' });

Updating a record is just as simple, pass the query to match the documents you wish to update, then the change you wish to make. To update all documents where the name === 'Jim' to age 20 simply write:

collection.update({ name: 'Jim' }, { age: 20 });

Finally you can remove documents as easily as inserting them:

collection.remove({ name: 'Jim' });

For a detailed overview of the query language ForerunnerDB uses please see the documentation on the official website at http://www.forerunnerdb.com.

15 questions
5
votes
2 answers

ENOENT no such file or directory when trying to load ForerunnerDB with requirejs

Hello I am using yo ko a knockout yeoman generator in my application. The application has been scaffold with requirejs and gulp, but I am having trouble adding ForerunnerDB to the require.config for distribution, here is the…
jean Pokou
  • 679
  • 5
  • 18
3
votes
2 answers

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…
Rob Evans
  • 6,750
  • 4
  • 39
  • 56
2
votes
1 answer

Existing ForerunnerDB database cleared after new ForerunnerDB() command

Cannot get ForerunnerDB to load existing data. Upon browser refresh, entire IndexedDB database disappears from Chrome resources after executing new ForeRunnerDB() command. var fdb = new ForerunnerDB(); // Existing database disappears from Chrome…
mpan111
  • 41
  • 4
2
votes
1 answer

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…
1
vote
1 answer

bootstrapping forerunnerDb into angular- electron app

am looking to use a forerunnerDB , as a standalone database and running an electron framework to create a desktop , am having problem implementing the bootstrapped process, var ForerunnerDB = require('forerunnerdb'); var fdb = new…
0
votes
1 answer

How to get collection name from forerunnerdb

Does anyone know how to get the collection name of a forerunnerdb database? I need to lookup what collecion data is in dynamically, but have not seen how to get the name of a collection created to check its name. Thanks
C Wells
  • 231
  • 3
  • 8
0
votes
1 answer

How can I select the latest version of an object from a ForerunnerDb collection

I have a collection which contains a series of objects generated over time. Since I have disparate types stored in the same collection, I have a TypeId and a UID per object (where the UID identifies objects that refer to the same entity over time).…
tobriand
  • 1,095
  • 15
  • 29
0
votes
1 answer

Why doesn't ForerunnerDB finds my tag?

I have the following setup: Barebones todo