IOT-DSA / dslink-dart-mongodb

MongoDB DSLink
Other
0 stars 2 forks source link

Instructions #7

Open badincite opened 5 years ago

badincite commented 5 years ago

any update instructions for the link I see no option to add connection just a place to set the broker address and nothing I enter works.

ilyatsarev commented 5 years ago

@badincite what exactly you enter and where?

badincite commented 5 years ago

Under links mongodb configs I set the broker address to mongodb://databaseip/databasename nothing shows up

Log shows

[2019-05-10 07:00:47.908728] == Exited with status 255 ==
[2019-05-10 07:00:47.877477] Unhandled exception:
[2019-05-10 07:00:47.877477] Could not import "package:logging/logging.dart" from "file:///C:/DSA/dsa-server/dslinks/mongodb/bin/run_old.dart": Could not resolve a package location for base at file:///C:/DSA/dsa-server/dslinks/mongodb/bin/run.dart
[2019-05-10 07:00:47.877477] #0      _asyncLoadErrorCallback (dart:_builtin:169)
[2019-05-10 07:00:47.877477] #1      _asyncLoadError (dart:_builtin:597)
[2019-05-10 07:00:47.877477] #2      _loadPackage (dart:_builtin:638)
[2019-05-10 07:00:47.877477] #3      _loadPackage.<anonymous closure> (dart:_builtin:654)
[2019-05-10 07:00:47.877477] #4      _handlePackagesReply (dart:_builtin:495)
[2019-05-10 07:00:47.877477] #5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
[2019-05-10 07:00:47.908728] == Exited with status 255 ==
[2019-05-10 07:00:47.877477] Unhandled exception:
[2019-05-10 07:00:47.877477] Could not import "package:logging/logging.dart" from "file:///C:/DSA/dsa-server/dslinks/mongodb/bin/run_old.dart": Could not resolve a package location for base at file:///C:/DSA/dsa-server/dslinks/mongodb/bin/run.dart
[2019-05-10 07:00:47.877477] #0      _asyncLoadErrorCallback (dart:_builtin:169)
[2019-05-10 07:00:47.877477] #1      _asyncLoadError (dart:_builtin:597)
[2019-05-10 07:00:47.877477] #2      _loadPackage (dart:_builtin:638)
[2019-05-10 07:00:47.877477] #3      _loadPackage.<anonymous closure> (dart:_builtin:654)
[2019-05-10 07:00:47.877477] #4      _handlePackagesReply (dart:_builtin:495)
[2019-05-10 07:00:47.877477] #5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
[2019-05-10 07:00:47.908728] == Exited with status 255 ==
ilyatsarev commented 5 years ago

@badincite broker address is the address of the DSA broker. To add new MongoDB database, right click on the Mongo dslink under /downstream and select "Add Database":

Screenshot 2019-05-16 16 26 34
badincite commented 5 years ago

Just got back into this I did get it connected however I would have expected my find query to ouput a table with the all queried documents values 1

2

butlermatt commented 5 years ago

@badincite Note that the db.collection.find() method returns a cursor. See the documentation from https://docs.mongodb.com/manual/reference/method/db.collection.find/

The second screenshot you show, is the objects referenced by the cursor, eg: db.collection.find({something:true}).toArray(); (converts the cursor to an array of documents)

https://docs.mongodb.com/manual/reference/method/js-cursor/

mneal-oii commented 4 years ago

@butlermatt - it looks like putting ".toArray()" at the end of my query causes the link to disconnect. I am sure I am missing something but the goal is to access the data in my dataflow. Can you offer some direction here?