Tagged Questions
MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms. Questions about server administration can be asked on http://dba.stackexchange.com.
0
votes
0answers
2 views
Is this a good architecture for a recursive MongoDB archiver written in NodeJS?
I am currently challenged with archiving data on a MongoDB server that has been running for over a year, accumulating nearly 100GB of data. The data model was designed in a way very similar to what ...
0
votes
0answers
7 views
Alternative to doing mysql COUNT
This is a follow-up questions this this one: Way to improve or eliminate a mysql COUNT, about improving a mysql COUNT.
SELECT COUNT(*) FROM mytable WHERE worker_id = 1 # worker_id is indexed
What ...
0
votes
0answers
11 views
Changing response doc object from findOneAndUpdate
Say I got this lil chunk of code:
Room.findOneAndUpdate({ Roomid: roomid }, { $push: { UsersMeta: UserMeta}}, { new: false }, function (err, room) {
if (err) console.log(err);
...
0
votes
1answer
12 views
MongoDB, issues with configuring and starting
I am new to mongoDB and i am trying to get it configured and running on my Ubuntu server. When i go and enter this command in my terminal
sudo service mongod start
I get the following output
...
0
votes
0answers
4 views
MongoDB logger as rack middleware
I have rails4 (unicorn + nginx) application with API part and I want to log to MongoDB every query with parsed params that goes to "/api/" path. I want to put it into rack middleware because if ...
0
votes
0answers
10 views
Mongodb Architecture - How to design so I can quickly know what is available
I am working on architecting an app in MongoDB. The goal here is to have very fast reads but slow writes are okay.
Suppose I have three collections: users, polls, and groups. users create polls that ...
0
votes
0answers
5 views
What is the correct syntax for the DB#command method that is replacing the convenience methods in the MongoDB Java client?
Mongo has deprecated some convenience methods in favor of raw commands, as can be seen here:
http://api.mongodb.org/java/2.12/com/mongodb/DB.html#addUser(java.lang.String, char[])
When trying to ...
0
votes
0answers
2 views
Return the textScore using the mongo C driver
I'm trying to recreate the following query using the mongo-c-driver.
db.djnNews.find({"date":"2014-02-06",$text:{$search:"GOOG"}},{score:{$meta:"textScore"}})
The text index is working fine. I can ...
0
votes
0answers
11 views
How to apply an mvc approach to the app.js file in a nodejs - express application
I've been following some nodejs - mongodb - express tutorials. I understand some of the basics such as the
the general principal of using app.js as a main (for want of a better term) controller for ...
0
votes
0answers
3 views
Import “normal” MongoDB collections into DerbyJS 0.6
Same situation like this question, but with current DerbyJS (version 0.6):
Using imported docs from MongoDB in DerbyJS
I have a MongoDB collection with data that was not saved through my
Derby ...
0
votes
1answer
11 views
How to test DoesNotExist exception of MongoEngine
I'm using MongoEngine with Flask to develop a REST Api
How can I test the exception of a DoesNotExist?
If I use
assertRaises(DoesNotExist, Model.objects.get(id=id))
python interpreter raises a ...
0
votes
0answers
27 views
How to improve a query with optional value in MongoDB?
I've this kind of query in MongoDB:
{ $and :
[{
$and:
[
{$or : [ { "$where": '?0 == \"\"'} , { a : {"$in": ?0} }]},
{$or : [ { "$where": '?1 == null'} , { b : ?1 ...
0
votes
0answers
16 views
Cached backend search algorithm
I am aiming to build a fast backend search with node.js, mongodb, redis and elastic search.
No frontend framework will be used, plain html will be returned by the server.
I am totally new to ...
0
votes
1answer
19 views
How to prevent mgo to unmarshal int to float64
I have unknown json structure data stored in mongodb. They have the fields to present the unix time like this:
"date": 1424803567,
I am using mgo to load them to the bson.M.
var result bson.M
...
0
votes
0answers
3 views
grails mongodb plugin criteria projections count
grails 2.4.4 , mongodb plugin 3.0.2
I have the following problem :
Domain Classes
class Person {
String id
Date lastUpdate
def name
Address address
}
class Address {
def street
...
0
votes
0answers
10 views
Calling res.render after delete query in nodejs
I'm working on a web project using MongoDB with nodejs. I currently have a modal popup, and when the user hits yes, it will send a post request. This request issues a delete query to my database, and ...
0
votes
0answers
6 views
Convert mongodb query to elastic query
We have an api biuld with mongodb as database. As the data is huge, we indexed all data in elastic search, so how can we convert mongodb query to elasticsearch query? Are there any plugins vailable? ...
0
votes
1answer
16 views
how to use a variable in an aggregate query in mongoose / node.js
I've got a very basic Mongoose aggregate query
Transaction.aggregate().match({
timestamp : {
$gt : time_lower_bound,
$lt : time_upper_bound
}
}).group({
_id : ...
0
votes
0answers
11 views
Unique files mongodb
I need to have unique files mongodb, I am using mongoose, and my code is well
mySchema.method({
putFile : function (data, cb) {
var item = this;
async.waterfall([
...
0
votes
0answers
14 views
springboot initialization error on startup with mongodb on gorm/groovy
Getting startup issues for this springboot project using MongoDB/GORM/Groovy on Java 1.7.0_55, gradle 1.11, and spring-boot-gradle-plugin:1.2.1.RELEASE.
I'm running the project as-is with the ...
2
votes
1answer
12 views
Logical operators in mongodb queries with python
I am trying to query my mongo db for a item in python2.7 with
output = collection.find_one({ $and : [{'name' : data['name']},{'phone_1' : data['phone_1']}]})
when I try to run the script python ...
0
votes
0answers
7 views
After switch to mongoDB auth::attempt does not work anymore
I recently switched my Laravel 4 Project to the mongoDB System using the jenssegers/laravel-mongodb Package.
The Seeds and migrations are fine, but the Auth::attempt function always returns false ...
0
votes
1answer
20 views
Search an array of objects in Mongo for any values contained in array
I'm trying to search Mongo to see if any of the strings in my array are being used in my "images.src.large":
Strings to search for:
...
0
votes
1answer
15 views
Complex query with mongoose, including subdocuments, near condition,
I have a very (at least for me) complex query using Mongoose.
First of all my schema:
var ObjectSchema = new Schema({
pickupStartDate: {type: Date, required: true, default: Date},
...
3
votes
1answer
21 views
Why does an aggregated set only return 100 results?
I'm currently learning mongodb, and trying to query measurements with an aggregate query (I know that the query doesn't make the most sense but it's a simplified version).
But somehow the query ...
1
vote
1answer
22 views
MongoDB: filter records by checking if subfield keys include a specified set
I have records in a MongoDB collection with the following structure:
{
'field1': {
'a': 3,
'b': 1,
'c': 4,
...
}
}
I want to find all records for which the ...
0
votes
0answers
34 views
How to push field into embedded document
Model
var ModuleSchema = new Schema({
name: String,
types: [{
name: String,
functions: [{
name: String
}]
}]
});
var CoverageSchema = new Schema({
...
0
votes
0answers
5 views
Is Money gem usable with Mongoid?
It fits in the "schema" or document model files just fine as a
type: Money
However, any time I need the Money I get a string of a float in return. I understand it's dealing with MongoDB internally ...
0
votes
1answer
7 views
How to install MongoDB on amazone linux and connect it to Laravel-jenssegers MongoDB?
I followed this for installing mongodb on Amazon Linux. I have a laravel project to host on my amazon Linux server. Jenssegers mongoDB is already installed in the framework while developing the web ...
1
vote
1answer
11 views
MongoDB finding all sub-nodes
I have categories collection with documents related to each other in a tree structure just as the simplified version shown below:
{
categoryID: "ABC",
parentID: "AB"
}
{
...
-3
votes
0answers
10 views
Secure web api for GPS devices [on hold]
I want to create a web api for GPS devices to securely send data to. How to ensure this web service is only accessed by my devices and not by unwanted components.
The back end plafrom is node ...
1
vote
1answer
15 views
Mongoose TypeError: Object {} has no method 'cast'
I'm trying to push an object into a Mongoose array, but am getting the following error:
TypeError: Object {} has no method 'cast'
at Array.MongooseArray._cast ...
0
votes
1answer
8 views
Creating file in GridFs (MongoDb)
I have two collections, LogData and OptData. LogData is having just 600 records whereas OptData is having around 3 million records. To make some logical data, I am trying to merge both colletions. But ...
0
votes
0answers
7 views
Doctrine MongoDB ODM in Laravel 5 doesn't support MongoDB driver
I'm using Laravel 5.0.6 with Doctrine MongoDB ODM.
The following are installed:
XAMPP 1.7.1
MongoDB 1.2.6
Laravel 5.0.6
MongoDB ODM 1.0.0
phpinfo() shows that MongoDB is enabled
I cannot find the ...
2
votes
1answer
28 views
MongoDB connection problems on Azure
We have an ASP.NET MVC application deployed to an Azure Website that connects to MongoDB and does both read and write operations. The application does this iteratively. A few thousand times per ...
0
votes
1answer
18 views
Mongodb doesn't start as a service
When I try to run Mongodb as a service sudo service mongodb start
I get
mongodb.log on pastebin.com
and service doesn't start. But simple run mongod works well. Sorry, but still can't google a ...
0
votes
1answer
26 views
mongodb date range search issue
I am trying to find the documents which dates are within a range. The range looks like this:
var start = moment("2015-02-24T00:00:00+01:00").format();
var end = ...
0
votes
0answers
12 views
Get username in url [Django] [mongoengine]
I am using django 1.7 with mongoengine. I have created a class Projects :
class Projects(Document):
user = ReferenceField(User, reverse_delete_rule=CASCADE)
p_name = ...
0
votes
1answer
19 views
Unable to run mongod inside ubuntu docker container through ssh (Docker is started using “--net=host”)
I referred to many links to solve this error SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly..
I ...
0
votes
0answers
5 views
Doctrine MongoDB - How to find duplicates in a column
In a collection with info about a site html content I want to find wich titles are duplicated. Collection structure:
address (url)
title (the title)
How can I do that with doctrine? for example if ...
0
votes
0answers
18 views
Coverting Circular structure to JSON in Moongoose and NodeJS
I am trying to build a query builder in mongodb with Node.Js as my back-end. So my server side code is like:
exports.runPostQuery = function(req, res) {
console.log(JSON.stringify(req.body.q));
...
0
votes
1answer
11 views
Setting a value on an undefined/null sub-document ObjectId field produces Cast to ObjectId error
Inside a MEAN.js app, I have a schema that has a subdoc ref:
var EmployeeSchema = new Schema({
supervisor: {
type: Schema.Types.ObjectId,
ref: 'User',
},
...
I'm able ...
1
vote
0answers
12 views
Getting opid and killOp using mongodb native client
I need to kill specific mongodb operations.
But mongo commands (like aggregate or mapReduce) whether they're called from the native node client or shell do not return their opids; so I can't match ...
0
votes
3answers
25 views
Mongodb returns no result on any match query
My data is like
myData[
{
id : 1,
name : "a1",
order : {
id : 1,
name : "o1",
status : "2"
}
},
{
id : 2,
name : "a2",
...
0
votes
1answer
17 views
How to connect meteor and mongoDB on separate machines
I want to connect the Mongo DB on the other server with meteor on my local machine.
Any help appreciated.I am new to meteor.
error on running meteor
Can't start Mongo server. ...
0
votes
1answer
25 views
MongoDB Returning One Nested Document from a Result
I have a MongoDB collection called "ballots" and it looks like this:
{
"_id" : "msw9ofwQSj58qiPvY",
"ballotName" : "This is the ballot name",
"votes" : [
{ "unitNumber" : "30", "voteResult" ...
-2
votes
0answers
13 views
MongoDB update error for a particular URL
I have a doc in MongoDB, which has some URL field with value as https://m.youtube.com/watch?vWnoBZnz0s_Y
There are some other fields in the same docs like isprocessed with values as 0 or 1. In this ...
0
votes
0answers
28 views
Adding, updating and deleting subdocument nested under subdocument
Following is my JSON data structure.
{
"id": "54e73250fc670bf2068e88c1",
"name": "abc",
"subCategory": [
{
"id": "54ec0c4ee4b036a9fa3767cd",
"name": "pqr",
...
0
votes
1answer
27 views
Mongodb $and not working properly
I try to find data using mongodb $and in my nodejs app but it not working properly .
my code -
var brand = req.param('Brand').split(',');
brand = '"' + brand.join('","') + '"';
...
0
votes
1answer
18 views
angular push adds operator that that results in MongoError
I am implementing the tutorial on the mean stack https://www.youtube.com/watch?v=AEE7DY2AYvI
I am adding a delete feature to remove items from the database on a button click
My client side ...