在MongoDB中如何获取保存的对象?
让我们首先创建一个变量。以下是查询-
> var studentDetails={"StudentFirstName":"Chris","StudentLastName":"Brown","StudentAge":24};以下是使用save()保存记录的查询-
> db.demo45.save(studentDetails);
WriteResult({ "nInserted" : 1 })在find()方法的帮助下显示集合中的所有文档-
> studentDetails;
这将产生以下输出-
{
"StudentFirstName" : "Chris",
"StudentLastName" : "Brown",
"StudentAge" : 24,
"_id" : ObjectId("5e25dab4cfb11e5c34d898ec")
}热门推荐
10 许愿星姐妹祝福语简短
11 朋友花篮开业祝福语简短
12 天气转凉祝福语简短
13 妹妹生日祝福语简短唯美
14 弟弟生日祝福语简短的话
15 新婚贺词简短的祝福语
16 三十三句祝福语简短
17 教练生日祝福语 简短独特
18 老爸生日暴富祝福语简短