I've some problem using mongojs. When I try to call a function (that is defined in a javascript file) from an html page I've got this error:
Uncaught Error: Module name "mongojs" has not been loaded yet for context: _. Use require([])
In the file…
Im using NodeJS to perform som Queries to a MongoDB.
I've set up the routing so when
http://127.0.0.1:8888/GetAllCities
is called, a function name GetAllCities will run on the server and perform a MongoDB query and return the result.
This…
I am a mongodb newbie and would greatly appreciate help on this problem described below.
I have two collections "users" and "bags". The user collections scheme has {username, firstname, lastname} and the bag collection schema has {username,…
Node.js, mongojs, mongodb.
I am searching through a list of skills using regular expressions. Here is my server code:
var nconf = require('nconf');
var db = require('mongojs').connect(nconf.get('mongolab:connection'), ['skills',…
I have MongoJS query call:
db.users.find({username:"eleeist"},function(err, docs) {
console.log(docs);
});
The docs variable looks like this in console output:
[ { _id: 4fee05662b17f88abbeb60b6,
username: 'eleeist',
password: 'test' }…
I'm playing with nodeJS and mongoJS. I've successfully queried the DB and returned a set of data:
var databaseUrl = "redirect"; // "username:password@example.com/mydb"
var collections = ["things", "reports"]
var db =…
I am running MongoDB server v6.0.4 on AWS EC2 Linux machine, which is publicly accessible.
Using MongoDB: 6.0.4
Using Mongosh: 1.8.0
/etc/mongod.conf
# network interfaces
net:
port: 27017
ipv6: true
bindIp: ::,0.0.0.0 # Tried with…
I've set up a function for my Express JS endpoint to 'await' to get a result from a Mongo DB using Mongo JS.
Function:-
async function getIntroducer(company){
const intro = await dbIntro.collection('introducers').findOne({company: company}, …
So, I'm trying to connect a mongo database and it's already connected. But my issue is that I can't read collection from mongo in another file, it says: db.collection is not a function.
So this is my db.js file:
const { MongoClient } =…
I'm trying to query my DB for users, but nothing happens when I try.
Here is my code to query the DB:
console.log("before db.user");
db.user.find({steamid: userSteamId}, function(err, user){
if(err || !user){
console.log("No account found,…
I've been having trouble with handling data from MongoDB using MongoJS where I have a promise that refuses to resolve. I am honestly confused why this does not work. It works completely fine on my local machine but once I move it to my server it…
I made the following filter in hopes that I would be combining the results from all 3 $and arrays but it is only matching one of those blocks.
How can I combine the results of what would be returned from each $and array if conditions are met.…