skip to Main Content

Update more than one inner document in MongoDb

In my example project, I have employees under manager. Db schema is like this; { "employees": [ { "name": "Adam", "_id": "5ea36b27d7ae560845afb88e", "bananas": "allowed" }, { "name": "Smith", "_id": "5ea36b27d7ae560845afb88f", "bananas": "not-allowed" }, { "name": "John", "_id": "5ea36b27d7ae560845afb88g", "bananas": "not-allowed"…

VIEW QUESTION

MongoDB group by date and select values

I'm relatively new to MongoDB and node.js. Here is what I'm trying to achieve: I have a collection that contains several thousand documents in MongoDB. The documents look like this: { "date": "2020-02-24", "iso_code": "USA", "country": "USA", "avg_temperature": "25F", },…

VIEW QUESTION

Mongodb – Unhandled Runtime Error TypeError: productsInfos.find(…) is undefined

import { useContext, useEffect, useState } from "react" import Layout from "../components/Layout" import { ProductsContext } from "../components/ProductsContext" export default function CheckoutPage(){ const {selectedProducts,setSelectedProducts} = useContext(ProductsContext) const [productsInfos,setProductsInfos] = useState([]); const [address,setAddress] = useState(''); const [city,setCity] = useState(''); const [name,setName]…

VIEW QUESTION
Back To Top
Search