建立数据库连接后如何获取所有文档

时间:2019-01-19 21:56:41

标签: node.js mongodb express mongoose

我是MongoDB的新手。这是我的设置

from imageai.Detection import VideoObjectDetection
import os

execution_path = os.getcwd()

detector = VideoObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
detector.loadModel()

video_path = detector.detectObjectsFromVideo(input_file_path=os.path.join(execution_path, "vid.mp4"),
                                output_file_path=os.path.join(execution_path, "traffic_detected")
                                , frames_per_second=20, log_progress=True)
print(video_path)

我在终端中收到控制台日志消息。所以我已经连接了。我没有架构,这个// backend/server.js const dbRoute = mongodb://[username:password@]host1[:port1]/[database]; mongoose.connect( dbRoute, { useNewUrlParser: true } ); let db = mongoose.connection; db.once("open", () => console.log("connected to the database")); 是只读的。如何获取所有文档并将其保存到我的本地mongoDB中?

0 个答案:

没有答案