Mongodb – How to keep user logged after browser closing in React – Express?
I am developing an application in React - Express - Mongo, how can i keep the user logged even after the browser is closed or page is refreshed?
I am developing an application in React - Express - Mongo, how can i keep the user logged even after the browser is closed or page is refreshed?
I have a document like this { "_id": ObjectId("626f942bb092f78afd9dad9d"), "item_id": "external _id222", "metadata": { "item_name": "abc", "quantity": 123, "state": null }, } What I would like to do is, $inc i.e. increment the count of quantity and then update the…
I get this error whenever I try to fetch data, I don't know why, it should show me posts but it gives me an error and a white page! This the error I get This the Posts.jsx code import Post…
Consider this data in mongodb: { "ordernumber" : "161288", "detail" : [ { "articlenumber" : "1619", "price" : 10, }, { "articlenumber" : "1620", "price" : 0, } ] } So basic order data with an array of articles in…
I have the following code to create a connection to my MongoDB database, and to store it for future use. const mongodb = require('mongodb'); const MongoClient = mongodb.MongoClient; // The database will be defined once a connection to between the…
Using mongoose I am querying a list of posts and would like to determine whether or not the user has liked the image or not within the query function by adding a boolean to the response JSON. I am trying…
After deleting many documents in my DocumentDB database, I reduced my collection to a size of 2.7GB but storageSize remains at 11GB. Is there any way to free up this space? In the WiredTiger implementation for MongoDB, there's a "compact"…
I'm learning Mongoose and I can't find in the documentation, nor in other questions on this site, why updateMany() needs to have a .then() in the end to be executed. As an example, here is the code I'm trying to…
Edit: I have solved my problem. The solution is in the comments. I'm trying to allow users to link other accounts to their main accounts on my app. When they go to link an account I want to ensure the…
How might I query MongoDB for all documents where at least one value in an array falls inside a range, e.g. 8 to 10. If I query it as an enumeration, this works as desired: {x : {$in: [8, 9,…