MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms.
1
vote
1answer
50 views
Spring MVC, Mongodb and java
I am avery beginner at SPring MVC, Mongodb and java. I am trying to make a sample application so that the user can serach, create, update and delete a customer:
My CustomerDAO class:
...
2
votes
1answer
60 views
Beginnings of Go web server with mongoDb
I am just learning how to use go and I'm a bit confused on how my code is supposed to be organised package wise.
Am I right to have the user package? I'm planning ...
2
votes
1answer
78 views
Callback hell, pyramid of doom
I am new to node, after I finished my APIs I realized that all of them are a mess, and are a callback hell, this forced me to learn about promises, now it was all good until I faced an API that has ...
6
votes
2answers
669 views
Twitter streamer that stores data in mongodb and emails errors
Here is a Python script that streams Twitter either with a keyword or within a bounded geographic area. Errors are emailed to my Gmail and the tweets are stored locally in MongoDB. Please let me know ...
1
vote
0answers
32 views
Implementation of user permissions
I am building a web-application in NodeJS (using TypeScript) and MongoDB (using Mongoose).
In my application I have 6 types of permissions. For the simplicity, let's use ...
4
votes
2answers
158 views
RESTful APIs (Create, Read) with flask-restful
I wrote this simple API to be able to send logs from the client to MongoDB. Even though this works and fits my need, I would like to point out some concerns that I have regarding the following:
Is ...
3
votes
0answers
110 views
0
votes
0answers
85 views
Update document if it exists otherwise create a new document - Mongoose
As the question states when the user submits a form mongoose checks whether the document for that user already exists, if yes then pushes an object into the array. If it does not exist then it creates ...
2
votes
0answers
21 views
Storing products in MongoDB with support for sorting by their number of followers
I'm loading products via an infinite scroll in chunks of 12 at a time.
At times, I may want to sort these by how many followers they have.
Below is how I'm tracking how many followers each product ...
3
votes
0answers
64 views
Converting MongoDB's IAsyncCursor(Source) into an Rx Observable Sequence
I've been toying with this idea for quite a while.
Needless to say that this really enables a lot of possibilities,
Especially when combined with a SignalR Backend.
Added below is what I came up with....
3
votes
3answers
36 views
Summing durations associated with each MAC address in a MongoDB result
I have a script which get data from MongoDB in the form of array and show the result. The array has a number of records in the thousands. A sample array is as follows:
...
1
vote
0answers
59 views
Scoping through embedded document in MongoId
I'm using MongoId in a Rails project. I need to select some products which contain some SKUs which has an embedded document. The models are respectively Product and ...
2
votes
0answers
63 views
Wrapping MongoDB Call Results in Observables
I have a number of functions that follow the basic pattern below. The intent is to provide a MongoDB implementation for a storage interface in a TypeScript application.
Is there a better way to ...
3
votes
0answers
145 views
Simple picture app for storing and viewing
Update: git repo: https://github.com/muhsinali/picture-example-minified
This is my first project that I've written using Scala and the Play framework. It's a simple application that allows the user ...
2
votes
0answers
54 views
CRUDL actions on MongoDB collection using Mongoose and NodeJS
I am using Mongoose ODM and NodeJS to implement CRUDL operations on MongoDB for further use with REST API. Initially, I've implemented functions using Promises but then switched back to callback style....
1
vote
2answers
73 views
Avoiding nested callbacks when using MongooseJS
I'm diving into the world of nodejs and mongo. I am playing around with a simple app that uses MongooseJS to talk to Mongo. I have been looking at examples and some GitHub projects for references, but ...
1
vote
2answers
168 views
Finding mongodb records in batches using mongoid [closed]
I want to get records in batches. But mongoid doc says to avoid using skip due as it can be expensive. I wrote this method to iterate through a large number records efficiently.
...
2
votes
1answer
41 views
'join' MongodDB collections with a for loop
This is a very simplified version of my query. Is it acceptable to join the two collections for the client with the use of for loops?
There could be up to 2,000 books, which also means there could be ...
0
votes
0answers
90 views
Get last n items from collection in order from least recent to most recent
I wanted to get the last n items from a MongoDB collection starting with the least recently added element (lowest id) and ending with the most recently added element. After that I want to stream them ...
1
vote
0answers
53 views
Node.js stream of objects from MongoDB
I have a collection inside MongoDB with thousands of documents. A document should be processing depending on some logic. To make the point simple, I suppose here there is a field ...
1
vote
0answers
100 views
GitHub user graph crawler using akka
This code queries the GitHub followers API and stores the graph in a mongodb collection:
...
1
vote
0answers
21 views
Matching a current user's “liked / followed” items with results from a search query
This is pretty ugly now. My main objective is to perform a search query, which I do via mongoosastic / elastic search (the search paginates 12 items at time). Then, I want to match those results with ...
0
votes
0answers
73 views
Generating a random ObjectID
We want to ensure that certain documents in our DB get distributed well across the shards. Currently the documents are sharded by their _id, but they are often ...
1
vote
0answers
186 views
1
vote
0answers
214 views
Handle decimal in mongodb
I'm trying to find a way to handle decimals in mongodb. Is there any good way and/or should I handle it with a class like this:
...
1
vote
0answers
27 views
MongoDB Per-Module Reusable DB Object With Reconnection Handled
This implementation was derived from the following requirements. I would like to learn that whether the implementation is clean enough, without memory leak and performance hit.
Requirements
Always ...
2
votes
1answer
96 views
2
votes
1answer
285 views
MongoDB CRUD operations for various types of data in Go
First of all I am a newbie in Go. I wrote a CRUD REST API that consists of handlers, a database layer and so on, and it contains a lot of code duplication. I see some patterns here, and I know how to ...
1
vote
0answers
46 views
Locate enteries to the nearest date selected
This code loops through a given range of dates and for every 5 minute iteration pulls up the last known records of the users in the database relative to that timestamp.
I'm trying to find a way to ...
2
votes
2answers
94 views
RSS to JSON for insertion into MongoDB
In my code, there is a chain of functions call where the deepest function may throw an exception. I catch and handle it according to the business logic. The problem is that all other functions in the ...
3
votes
1answer
108 views
Retrieve rich text from GridFS with Java
I am writing a storage for articles and I have decided to use GridFS from MongoDB. I have found and tested some code, but I am not sure that it is a best one. Could you advice me how to make it better?...
2
votes
0answers
119 views
Managing modules in phone book app
This is a test app built with NodeJS, Express and MongoDB. This code is the main and complete JavaScript file. I would like suggestions on dividing it into different modules and making the main app.js ...
1
vote
0answers
39 views
Script to migrate event, artist, and venue information from MongoDB to Drupal
At first I brute forced the migration to just get it finished. However, the procedural program mixed the events with the venues so I rewrote it, this time using classes which I'm just beginning to use....
2
votes
0answers
65 views
Knowledge base app using MEAN stack
I've been working on an app based on the MEAN Framework. I have got the app working but I just wasnt sure whether my coding structure and standard was good enough, meaning does it adhere to the ...
1
vote
0answers
471 views
1
vote
0answers
47 views
Properly updating multiple MongoDB documents with Angular
In the app I'm creating, when a user upvotes a post, the post should be upvoted, as well as the user that wrote the post. But this updates two MongoDB documents. This presents a number of issues. I'll ...
4
votes
1answer
558 views
Nesting BsonDocuments in MongoDB queries
I have a MongoDB collection setup where each document's JSON looks like this:
...
2
votes
0answers
448 views
Sentiment analysis on tweets in MongoDB
What i have done here is used 2 scripts in which from my main file I am using streaming api for particular handles and that data being directly pushed to ...
4
votes
1answer
61 views
MongoDB - Find records in one collection that match string in 2nd collection
I have a MongoDB collection of product IDs/unique products attributes and a second collection of codes that relate to attributes common for products whose IDs are prefixed with those codes.
For ...
5
votes
1answer
444 views
Listening from Mongodb always and triggering
I am using classes for the first time. In this program I want the object to run infinitely so that any change in the MongoDB will trigger the function and do the necessary processing.
I am little ...
1
vote
1answer
446 views
mongodb query in waterline,sailsjs
Because it is a lot of code, I don't want to ask for details what is wrong, but want to ask about review what can be changed in approach to this.
This is controller that make query:
It grabs data ...
4
votes
1answer
541 views
Updating state with React
I am creating a blog using React, MongoDB, Express and Node. I have three components: App, List, and Item. The item is a blog post; the list is a list of the blog posts, and the app includes a place ...
5
votes
1answer
174 views
Image duplicate finder
I have a bunch of exact-duplicate pictures that I've acquired over the years. I'd like to create a list of all them so I can eventually delete some. My idea was simple: dump the hash and location of ...
14
votes
2answers
191 views
Builder pattern for users in document database
I'm attempting to make a builder pattern that makes sense and is practical for storing user data in a flexible way in a document database. The DB I chose is MongoDB, and I'm using its Java API ...
2
votes
0answers
58 views
Trade off in database efficiency versus a nested for loop on client
I built an app where a user has a recipe box with recipes in it - for the db, there is a user and recipe model, user has "recipeBox" property. The recipebox is an array of objects like so:
User ...
0
votes
0answers
2k views
A plugin that integrates Angular Smart Tables with Mongoose DB for server side pagination
I'm using Angular Smart Tables with data that might become a huge set of documents and rows. So rather than client side processing of the data for pagination, I borrowing code from two Mongoose.js ...
3
votes
2answers
566 views
7
votes
3answers
67 views
Pulling Docker Machine IP
I am working with MongoDB through Docker, and I have a terrible bash command to pull the Docker Machine IP so I can sanely connect locally.
...
8
votes
1answer
61 views
Retrieving StackExchange sites and tags
I have setup agenda tasks to periodically retrieve and possibly insert new SE sites and tags in my MongoDB database.
Some things that bother me in particular:
Lots of code duplication
No string ...
0
votes
1answer
209 views
Flattening a 2D array to use map/reduce
I have been trying to get better at functional programming, which includes understanding map/reduce. I wrote a function intended to fill an autocomplete with values. The challenge I was encountering ...