【发布时间】:2020-01-25 13:36:33
【问题描述】:
我对 Mongo 非常陌生(以前也没有关于 Db 结构的知识)和 Python 环境,我的要求是创建一个配方 Db。添加数据后,我可以在其中获取带有成分的食谱。
在monog db成分中查找项目是相似的,
例子
食谱 - 1. 咖喱鸡 - (鸡肉、洋葱、西红柿、油),准备文本 2.鸡肉卷-(鸡肉,洋葱,小麦粉,油),准备文本 3. Paneer Roll -(芝士、洋葱、小麦粉、油),准备文本 4. Paneer Sandwich - (Paneer, onion, bread, oil), 准备文本
所以在我的 API 调用中应该有什么查询来获取配方成分。 例子, 1.查询-Paneer:结果食谱:Paneer Roll,Paneer Sandwich 2.查询-Paneer, onion, bread: Paneer Sandwich 3.查询-鸡肉,西红柿:咖喱鸡
它应该返回相关的食谱。请帮助解决这个问题。如果有其他适合此要求的数据库,请告诉我。
{
"category": "Indian",
"recipe_url": "https://www.allrecipes.com/recipe/222667/dal-makhani-indian-lentils/",
"recipe_name": "dal makhani (indian lentils)",
"recipe_short_description": "\"ever go to an indian restaurant and wonder how they make those lentils? i hated lentils before i discovered indian food then i scoured the internet to figure out how they achieved them and through mixing and matching recipes and methods on videos ive arrived at this recipe which i think is pretty close this version is very rich but you can leave out the cream to make it lighter kasuri methi (fenugreek leaves) is almost impossible to find in the us even in nyc but it gives this dish something very special\"",
"image": [
{
"url": " \"https://images.media-allrecipes.com/userphotos/560x315/1257894.jpg\""
}
],
"recipe_calories": "390 cals",
"recipe_preptime": "4 h 15 m",
"recipe_servings": "\"6\"",
"recipe_ingredient": [
{
"ingredient_desc": "1 cup lentils",
"amount": "1 ",
"ingr": "cup lentils",
"content": "lentils"
},
{
"ingredient_desc": "1/4 cup dry kidney beans (optional)",
"amount": "1/4 ",
"ingr": "cup kidney beans",
"content": "beans"
},
{
"ingredient_desc": "water to cover",
"amount": "",
"ingr": "water",
"content": "water cover"
},
{
"ingredient_desc": "5 cups water",
"amount": "5 ",
"ingr": "cups water",
"content": "water"
},
{
"ingredient_desc": "salt to taste",
"amount": "",
"ingr": "salt taste",
"content": "taste"
},
{
"ingredient_desc": "2 tablespoons vegetable oil",
"amount": "2 ",
"ingr": "vegetable oil",
"content": "oil"
},
{
"ingredient_desc": "1 1/2 tablespoons ginger paste",
"amount": "1/2 ",
"ingr": "ginger paste",
"content": "paste"
},
{
"ingredient_desc": "1 1/2 tablespoons garlic paste",
"amount": "1/2 ",
"ingr": "paste",
"content": "paste"
},
{
"ingredient_desc": "1/2 teaspoon ground turmeric",
"amount": "1/2 teaspoon",
"ingr": "ground",
"content": "turmeric"
},
{
"ingredient_desc": "1 pinch cayenne pepper or more to taste",
"amount": "1 ",
"ingr": "pinch cayenne pepper",
"content": "pepper taste"
},
{
"ingredient_desc": "1 cup canned tomato puree or more to taste",
"amount": "1 ",
"ingr": "cup tomato puree",
"content": "canned puree taste"
},
{
"ingredient_desc": "1 tablespoon chili powder",
"amount": "1 ",
"ingr": "chili powder",
"content": "powder"
},
{
"ingredient_desc": "add all ingredients to list",
"amount": "",
"ingr": "",
"content": ""
}
],
"recipe_description": "\"ever go to an indian restaurant and wonder how they make those lentils? i hated lentils before i discovered indian food then i scoured the internet to figure out how they achieved them and through mixing and matching recipes and methods on videos ive arrived at this recipe which i think is pretty close this version is very rich but you can leave out the cream to make it lighter kasuri methi (fenugreek leaves) is almost impossible to find in the us even in nyc but it gives this dish something very special\"",
"recipe_procedure": [
{
"step": "0",
"desc": "place lentils and kidney beans in a large bowl; cover with plenty of water soak for at least 2 hours or overnight drain"
},
{
"step": "1",
"desc": "cook lentils kidney beans 5 cups water and salt in a pot over medium heat until tender stirring occasionally about 1 hour remove from heat and set aside keep the lentils kidney beans and any excess cooking water in the pot"
},
{
"step": "2",
"desc": "heat vegetable oil in a saucepan over medium-high heat cook cumin seeds in the hot oil until they begin to pop 1 to 2 minutes add cardamom pods cinnamon stick bay leaves and cloves; cook until bay leaves turn brown about 1 minute reduce heat to medium-low; add ginger paste garlic paste turmeric and cayenne pepper stir to coat"
},
{
"step": "3",
"desc": "stir tomato puree into spice mixture; cook over medium heat until slightly reduced about 5 minutes add chili powder coriander and butter; cook and stir until butter is melted"
},
{
"step": "4",
"desc": "stir lentils kidney beans and any leftover cooking water into tomato mixture; bring to a boil reduce heat to low stir fenugreek into lentil mixture cover saucepan and simmer until heated through stirring occasionally about 45 minutes add cream and cook until heated through 2 to 4 minutes"
}
],
"recipe_nutrition": "per serving: 390 calories; 215 g fat; 371 g carbohydrates; 132 g protein; 48 mg cholesterol; 420 mg sodium full nutrition",
"_id":
这是 mongo db 中的示例配方代码。请让我知道这是否是将配料放入 mongo 的正确方法。如果它是什么方法来获取类似的项目。请帮忙
【问题讨论】: