用MongoDB循环和组成数组?

时间:2018-12-08 22:56:48

标签: python mongodb flask

我想知道是否可以为mongo文档中的单个键提供多个字符串值?我将mongo与python flak应用程序连接,但遇到了一些令人沮丧的困难。我会在这里更好地说明自己:

2018-10-26
2018-10-25
2018-10-24

在cipient_ingredients中,是否可以包含所有这三个字符串,而不会在浏览器上得到此响应:

{"_id": {"$oid": "5c0c0843e7179a2e2704fe86"
},
"category_name": "Breakfast",
"recipe_name": "Scambled Egg",
"recipe_ingredients": [
"Eggs",
"1/4 cup of Milk",
"2 tsp. Butter"
],
"recipe_servings": 2,
"recipe_author": "Sally Reynolds",
"recipe_calories": 192,
"recipe_country_of_origin": "England",
"step_one": "BEAT eggs, milk, salt and pepper in medium bowl until blended., HEAT butter in large nonstick skillet over medium heat until hot. POUR IN egg mixture, GENTLY PULL the eggs across the pan with a spatula, forming large soft curds.",
"prep_time": "1 Minute",
"cooking_time": "4 Minutes",
"vegan": "false"enter 
}

我只想显示这三个项目

0 个答案:

没有答案