All!
My document has such structure:
{
fname: value,
lname: value,
city: value
}
When I use find() method, I get result in default order fname, lname, city.
But I want to get result in other order of field, such as: city, fname,…
I'm using mongojs to interact with mongodb in my app.
I need to add TTL support for the collection making the documents delete themselves every hour.
Here's how I'm creating index on app start:
db.collection.ensureIndex({'createdAt': 1,…
I have a collection, in this collection all my records have, for example, a field named "car".
I get a new name for this field from my form and i would like to go through all my records and change only the fields name, without changing the value.
I…
I am trying to make pagination work with MongoDB without skip();
In mongo shell I got the following results with my query, but in Javascript a empty [];
I think I am doing the ObjectID wrong, I use the "mongodb ObjectID" and "mongojs" libs with…
I have successfully connected to MongoDb and used a form to send some data. I would now like to store the data in a json document with a collection. So my current output is:
{
"_id": "53be957007d2c838083046a6",
"subscriberinfo": "X",
…
I have a MongoDB collection with documents that look as follows:
{
"id": 51584,
"tracks": [],
"_id": {
"$oid": "ab5a7... some id ...cc81da0"
}
}
I want to push a single track into the array, so I try the following NodeJS…
I'm trying to dynamically generate the $set values to update a users account details in the database. I'm using mongojs. Here is a portion of the code.
var updateData = '';
if(data.avatar_url) {
updateData += "avatar_url: \"" +…
I'm new to MongoDB but here goes:
Is there a way to do a form of partial search in MongoDB?
For example, if the document is something like { Name: Michael A. Johnson}, is there a way to format search so that it will return that document for a query…
Iam trying to save/insert in MongoDB
using express and mongoJS
My Code
:
var port = 8580;
var express = require ('express');
var app = express ();
// import mongojs Modul
var mongojs = require("mongojs");
//connect
var db =…
I am trying to write a custom bulk upload script using the new mongo bulk apis. I am using UnorderedBulkOp which works really fast initially, but after being called several times it begins to hang. I've tried using log lines and it seems that after…
I'm new to Node.js, MongoDB and MongoJS.
I have app.js which is the server I run from my command line with node app.js. On a local machine with OS X 10.9.1 with Node.js v0.10.28.
In app.js I have (as snippets)
var db = require('./database');
var…
I have an Android Application and a Server with Node.js that uses Restify.js and MongoJS to store data from and to my android application.
For now, I am using JSONArray from Android (but in my case, it's json-simple lib based on original lib) and I…
I need to make a MongoDB query and add an extra field to each one of my results. The field values depend of the result of another query.
I'm trying to call the nested query in my server.js code. It's not working because res.json(data) is called…
I'm trying to query two separate collections using MongoJS (node.js mongodb wrapper) to build an array of objects that I'll then render with my view using EJS.
The issue I've run into seems to do with scoping.
function getTeamMembers(projectID){
…