Skip to main content

All Questions

1 vote
1 answer
54 views

Search for a record that has a relationship to objects with specific value using Mongoid

Consider the following model diagram representing two models of my Rails project. The Implement model represents an "object" that a person has, for example a person can have a helmet, bag, shield, etc....
ravelinx's user avatar
  • 1,815
-2 votes
1 answer
167 views

Create related tables in mongodb

I'm developing a simple forum app in Ruby on Rails, with MongoDB. It's supposed to have these basic things: Topics -Author name -Topic name -Topic text (content) and Comments -Name of commentator ...
Tony K's user avatar
  • 61
0 votes
2 answers
1k views

How to store football teams, games and scores in MongoDB

I'm design football statistic application. I stuck with storing game (match) result. I have Team object and Game object. First I make Game model look like class Game include Mongoid::Document ...
atomAltera's user avatar
  • 1,801
0 votes
2 answers
550 views

has_many relation via IDs list in parent

I got in trouble while designing data model. I have master object "A" with its children "B", and "B" has many "C", but some "C" can also be free (not belong to any "B"). By standard mas_many/...
atomAltera's user avatar
  • 1,801
6 votes
1 answer
2k views

MongoDB Conversation / Private Message Schema using Mongoid

I'm building a forum system in Rails in order to become more acquainted with Rails and Mongoid. A feature I'd like to add is a private message system forum users can use to message each other. In ...
CarelZA's user avatar
  • 1,227
2 votes
3 answers
507 views

Should I move to MongoDB to avoid SQL injection vulnerability in Rails? [closed]

There is a big concern regarding a recently-disclosed Rails SQL injection vulnerability. I am not well-versed in dealing with security, so I am unnerved. I hear that MongoDB is not susceptible to this ...
AdamNYC's user avatar
  • 20.5k
1 vote
2 answers
187 views

Mongoid embeddable comments and user info that can change

I have an List document with embedded Comments. Along with the user's comment in the view, I'd like to display their screen name and profile picture. The profile picture could change and so could ...
aressidi's user avatar
  • 680
2 votes
1 answer
254 views

Rails: How to model objects with a mix of both fixed and dynamic data

I am building a site with a database of users. I am using arbor.js to build a graph for each user. The graph is a tree-like structure with edges and nodes that looks something like this (I had an ...
Logan's user avatar
  • 165
1 vote
1 answer
620 views

How to model a many self-referential relationship with many parents?

I want to model out the following in the easiest way: A skill has many dependent skills. Each skill should exist on their own, and a skill may have other skills that are prerequisite skills. For ...
Daniel Fischer's user avatar
1 vote
2 answers
1k views

MongoDB: Modeling likes, mutual friends etc

I'm building a streaming music service that will have features like: Follow users Like songs Create and manage playlists ...etc. I'm using Rails 3.1, Mongoid and MongoDB. I'm unsure how I should model ...
Johan's user avatar
  • 1,927
3 votes
2 answers
5k views

CQRS in a Rails environment?

I'm trying to wrap my head around CQRS (Command Query Response Separation) per Martin Fowlers recent post at: http://martinfowler.com/bliki/CQRS.html Given a project: Main Database (Postgres): ...
Allyl Isocyanate's user avatar
2 votes
2 answers
800 views

How to structure data model for an advertising tool in MongoDB

I am building an ad analytics tool which assumes a data structure like this: Account Campaign Keyword Conversion I have a lot of information about individual conversion events, which can be tied back ...
Avishai's user avatar
  • 4,760
2 votes
1 answer
342 views

Schemaless DBs: Indexing dynamically-typed things by their properties?

In a RDBMS you can declare types (tables) and subtypes (subtype tables with supertype FKs). In Rails this would be Class Table Inheritance. For example, you could have Person table and a Friend ...
M. Lanza's user avatar
  • 6,800
4 votes
3 answers
655 views

Advice on Simple MongoDB Database Structure

I'm just getting started with MongoDB and Mongoid for Rails and in need of some advice on the right way to design a simple blog database. I'm currently using the structure below, but I need a way to ...
Chris Blunt's user avatar
-1 votes
1 answer
2k views

Need suggestions on designing artist recommendation

I have the following scenario.I need to recommend artists to users. How should this be modeled? I am looking for suggestions on this. I was thinking. Based on following criterias: When a user listens ...
Christian Fazzini's user avatar

15 30 50 per page