mangodb_test.py 479 B

1234567891011
  1. from src.kg_construction.mongodb_cache import MongoDBConn
  2. if __name__ == "__main__":
  3. host_port = 'mongodb://8.142.150.114:27018/'
  4. db_name = 'nebula-kg-cache'
  5. assemble = 'mechatronics-entity-seed'
  6. mongoDBConn = MongoDBConn()
  7. collection = mongoDBConn.initConnect(host_port=host_port, db_name=db_name, assemble=assemble)
  8. triple_sample_templete = {'name': 'MongoDB', 'type': 'database'}
  9. collection.insert_one(triple_sample_templete)
  10. print(collection)