sync_server icon indicating copy to clipboard operation
sync_server copied to clipboard

mongo connector

Open ccgman123 opened this issue 6 years ago • 5 comments

@nponiros So the server seems to boot and work well with the samples included. The only change I had to make so far was in the changes_table.js. I kept getting an error when trying to boot the server telling me that this.store.find(query).sort({ rev: 1 }).exec() is not a function. so i swapped the function with this.store.find(query).sort({ rev: 1 }).toArray()
seems to work just fine.

Does your syn-client package have a web small website example to test ?

ccgman123 avatar Jan 19 '18 22:01 ccgman123

Good to hear.

https://github.com/nponiros/bookmarks_manager uses the sync-client but it is not really a small example. Files under the actions folder use the sync-client. The sync-client itself is initialized the the db folder.

nponiros avatar Jan 20 '18 16:01 nponiros

@nponiros thanks. Would the sync client package work with angular 4+ ? I have followed the same pattern from your dexie angular example from a year ago.

` import { Injectable } from '@angular/core'; import SyncClient from 'sync-client';

@Injectable() export class DexieService extends SyncClient { constructor () { super('Logbook', [{ version: 1, stores: { test: '_id' } }]); } } ` When I use this pattern the project compiles however when I run in the browser I errors in zone.js.

Thanks

ccgman123 avatar Jan 23 '18 00:01 ccgman123

Generally speaking there is no reason why the sync-client shouldn't be able to work with angular. What you are experiencing is probably this dexie issue. The sync-client still uses a rather old version of dexie. I will try to update it today.

nponiros avatar Jan 23 '18 08:01 nponiros

I published 1.0.0-beta.10 of sync-client with the latest dexie versions. Check that out and let me know if the issue is fixed.

nponiros avatar Jan 23 '18 09:01 nponiros

That was exactly the error I was getting. It works now. Thanks

ccgman123 avatar Jan 26 '18 18:01 ccgman123