Radizzt
Radizzt

Reputation: 137

MeteorJS Offline Database

I'm trying to create an app that only require an offline database. Previously when I was making android apps in Android Studio I was using SQLite3 as the database. I didn't need to be connected to the internet to load that data.

Is it possible with the MeteorJS? Currently I'm using MongoDB and I'm hoping there's some way I can create something similar to that, so I don't need any internet connection to use the app. I'm basically done with the app if I can somehow manage this.

Upvotes: 1

Views: 369

Answers (2)

Mathieu K.
Mathieu K.

Reputation: 933

The best way I've found to do that is Ground db:

meteor add ground:db

Once added, you can create a purely local collection with :

foo = new Ground.Collection('test');

here is he github repository.

Upvotes: 1

Mikkel
Mikkel

Reputation: 7777

There are several options for solving this.

If you are on Android you can use sqlite with meteor.

You can also use indexedDB, which is technically deprecated (only due to lack of standards support) but does work well in some places. Can I use has the details: http://caniuse.com/#feat=indexeddb If you are using crosswalk in your app, you are guaranteed to have up to date chrome, at least on Android.

There is also a package called lokijs (which I haven't used) to do local and persistent data storage. http://lokijs.org/#/. It promises cordova support

Upvotes: 1

Related Questions