‎02-10-2021 07:40 AM
Hello,
I am new to Neo4j and Mongo DB. I want to import some collections from Mongo DB to Neo4j. I have went through multiple links and blog but couldn't import it.
Procedure 1:
CALL apoc.mongodb.get('mongodb+srv://:@<Cluster_Name>','','',false,'','') yield value
Error:
Type mismatch: expected Map, Node or Relationship but was Boolean (line 1, column 105 (offset: 104))
"CALL apoc.mongodb.get('mongodb://:@<Cluster_Name>/test1','','',false,'','') yield value"
Procedure 2:
CALL apoc.mongodb.first('mongodb://:@<Cluster_Name>','','',{name:'testDocument'})
Error:
Failed to invoke procedure apoc.mongodb.first
: Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address:27017=normativedevcluster0-fqz8w.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: normativedevcluster0-fqz8w.mongodb.net}, caused by {java.net.UnknownHostException: normativedevcluster0-fqz8w.mongodb.net}}]
But same URL I am able to connect from Mongo DB Compass
Any help or suggestions?
Thanks in Advance
Solved! Go to Solution.
‎02-11-2021 07:50 AM
Try with:
call apoc.mongodb.first('mongodb://temp_user:@cluster0-shard-00-01.tvk5k.mongodb.net:27017?retryWrites=true&ssl=true', 'test', 'test1', {}) yield value
return value
``
‎02-10-2021 10:12 AM
Hi @prishabh35 I wrote this article about you to automatically transform Mongodb collections into graphs in Neo4j:
I hope it helps
‎02-10-2021 10:35 AM
Thanks for the help!,
Can we do this without Docker?
‎02-10-2021 12:57 PM
Sure you only need APOC
‎02-10-2021 10:12 PM
Could you please identify what mistake I am making?
mongodb+srv://temp_user:@cluster0.tvk5k.mongodb.net/test?authSource=admin&replicaSet=atlas-2zthi9-shard-0&w=majority&readPreference=primary&appname=MongoDB%20Compass&retryWrites=true&ssl=true
call apoc.mongodb.first('mongodb://temp_user:@cluster0-shard-00-01.tvk5k.mongodb.net:27017', 'test', 'test1', {}) yield value
return value
Neo.ClientError.Procedure.ProcedureCallFailed
Failed to invoke procedure apoc.mongodb.first
: Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address:27017=cluster0-shard-00-01.tvk5k.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]
‎02-11-2021 07:50 AM
Try with:
call apoc.mongodb.first('mongodb://temp_user:@cluster0-shard-00-01.tvk5k.mongodb.net:27017?retryWrites=true&ssl=true', 'test', 'test1', {}) yield value
return value
``
‎10-08-2021 02:09 AM
What is crendentials for URL and user authentication for the neo4j instance? @conker84