Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/411.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何通过内容关系与NOSQL access连接ReactJS?_Javascript_Reactjs_Django_Mongodb_Nosql - Fatal编程技术网

Javascript 如何通过内容关系与NOSQL access连接ReactJS?

Javascript 如何通过内容关系与NOSQL access连接ReactJS?,javascript,reactjs,django,mongodb,nosql,Javascript,Reactjs,Django,Mongodb,Nosql,我很难找到如何通过api连接我的组件。 我以前用过微软的SQL,当时我用外键来做这个东西,但现在我真的被困在这里了。下面是一些例子 从api端点获取所有酒店 [ { "id": 51, "name": "Hotel Hollywood", "city": "Sarajevo", "country": &qu

我很难找到如何通过api连接我的组件。 我以前用过微软的SQL,当时我用外键来做这个东西,但现在我真的被困在这里了。下面是一些例子

从api端点获取所有酒店

[
    {
        "id": 51,
        "name": "Hotel Hollywood",
        "city": "Sarajevo",
        "country": "Bosnia & Herzegovina",
        "image": "http://127.0.0.1:8000/media/images/no-img.jpg",
        "stars": 4,
        "date": "2020-09-08 12:22:53",
        "description": "Hotel Hollywood provides free, secured private parking on site. It also offers 18 conference and meeting rooms.",
        "price": 1500.0,
        "likes": 0,
        "dislikes": 0,
        "user": [
            1
        ],
        "location": "1.2"
    }
]
[
    {
        "id": 5,
        "name": "Art Hotel",
        "city": "Belgrade",
        "country": "Serbia",
        "image": "/media/images/art.jpg",
        "stars": 1,
        "date": "2017-07-04 10:50:12",
        "description": "Featuring an on-site restaurant and Situated on Belgrade's impressive pedestrian street and shopping zone, Art Hotel's décor is inspired by Italian style. The property offers individually designed, air-conditioned rooms and suites with minibar, free high-speed WiFi, free sauna and hairdryers.\r\n\r\nOffering views of the vibrant Knez Mihailova Street, the elegant Mosaic Restaurant & Bar serves a selection of quality wines and various specialities made from seasonal ingredients, a variety of coffees and homemade desserts, including ice cream and authentic Liège waffles.",
        "price": 40.25,
        "likes": 0,
        "dislikes": 0,
        "user": [
            1,
            91
        ],
        "location": "44.8168788,44.8168788"
    }
]
从api端点获取所有酒店收藏夹

[
    {
        "id": 51,
        "name": "Hotel Hollywood",
        "city": "Sarajevo",
        "country": "Bosnia & Herzegovina",
        "image": "http://127.0.0.1:8000/media/images/no-img.jpg",
        "stars": 4,
        "date": "2020-09-08 12:22:53",
        "description": "Hotel Hollywood provides free, secured private parking on site. It also offers 18 conference and meeting rooms.",
        "price": 1500.0,
        "likes": 0,
        "dislikes": 0,
        "user": [
            1
        ],
        "location": "1.2"
    }
]
[
    {
        "id": 5,
        "name": "Art Hotel",
        "city": "Belgrade",
        "country": "Serbia",
        "image": "/media/images/art.jpg",
        "stars": 1,
        "date": "2017-07-04 10:50:12",
        "description": "Featuring an on-site restaurant and Situated on Belgrade's impressive pedestrian street and shopping zone, Art Hotel's décor is inspired by Italian style. The property offers individually designed, air-conditioned rooms and suites with minibar, free high-speed WiFi, free sauna and hairdryers.\r\n\r\nOffering views of the vibrant Knez Mihailova Street, the elegant Mosaic Restaurant & Bar serves a selection of quality wines and various specialities made from seasonal ingredients, a variety of coffees and homemade desserts, including ice cream and authentic Liège waffles.",
        "price": 40.25,
        "likes": 0,
        "dislikes": 0,
        "user": [
            1,
            91
        ],
        "location": "44.8168788,44.8168788"
    }
]
正如你们所看到的,我的“用户”键是一样的,我认为它和“外键”一样好,但我不知道如何连接这两个键

提前感谢您的时间和回答

编辑: 我把上面不同的数据作为例子,最终,我会在我的项目中连接相同的数据