Questions tagged [moped]

62 questions
0
votes
1 answer

How to measure moped insert runtime in a ruby mongoid app?

I'm currently writing a moped log parser in order to monitor moped queries runtime. It's work great for QUERY command using the runtime parameter, but INSERT and UPDATE have no runtime parameter. All INSERT and UPDATE are followed by a getLastError…
0
votes
0 answers

Mongoid migration update fields from String to Timestamp without using Models

I want to update a field of a collection, that actually has a string representation of a date, and change it to an ISODate. I have a solution already, but It's is inefficient: class MoveTimestampsFromStringToTimestamp < Mongoid::Migration def…
TlmaK0
  • 3,578
  • 2
  • 31
  • 51
0
votes
1 answer

Mongoid preferred read replica

I'm building a geo redundant MongoDB replica set, but there is a problem. Every time a query is sent to the database apparently a random replica is choosen. MOPED: x.x.x.0:p COMMAND database=admin command={:ismaster=>1} runtime:…
bukk530
  • 1,858
  • 2
  • 20
  • 30
0
votes
0 answers

mongodb $group aggregation yields _id with multiple values as array; how to remove dupes from _id?

I am trying to conduct a very simple aggregation to collect some indexes associated with a particular owner. My query is as follows (in moped syntax): owners = Serials.collection.aggregate([ {'$group' =>…
diego
  • 123
  • 2
  • 14
0
votes
1 answer

MongoDB search query for stats

I have an event collection in MongoDB that contains some HTTP requests informations. I would like to know if there's a way to find the "dyno" that has responded the most based on a specific "path" value. For example for "random_path_users" I would…
Mich
  • 729
  • 1
  • 7
  • 14
0
votes
0 answers

how to match the last value of array in mongo db?

I'm trying to fetch some data from db. Here is my query which I have tried. My issue is that my out has dc_id which is an array. I'm using $eleMatch, which returns 1st matching element. what if I want to match last value? tasks =…
Kranthi
  • 1,377
  • 1
  • 17
  • 34
0
votes
0 answers

How to create an index on this MongoDB document?

In my offers collection I have documents like this: { "_id" : ObjectId("535419d2d6ad229f217359af"), "application" : "app1", "category_id" : "nord outdoor", "category_name" : "nord outdoor", "id" : "810928", "name" : "offer name", "ref_code" :…
0
votes
2 answers

Moped: How to adduser to a mongo database

Is there a way to add user to a database from Moped. I dont see any equivalent command to mongo console db.addUser(user, pass, [roles])
ducktyped
  • 4,354
  • 4
  • 26
  • 38
0
votes
1 answer

Why does the same Moped query sometimes take longer?

When a ruby on rails web page is requested, sometimes the database query takes 2-4x as long. I've enabled debug logging for Moped and saw lines like this: D, [2013-11-21T23:11:10.889418 #7690] DEBUG -- : MOPED: 127.0.0.1:17203 QUERY …
Stephen
  • 171
  • 1
  • 6
0
votes
1 answer

Mongoid / Moped Date Type Insertion Failure

The problem deals with mongoid / moped DATE type insertion. My code is below s=Moped::Session::new(["127.0.0.1"]) s.use "test" s["a"].insert mydate: Date.strptime("10/02/2014","%m/%d/%Y") raises an error # => undefined method `__bson_dump__' for…
0
votes
1 answer

Is moped's (Ruby mongodb driver) remove_all operation a background operation?

It returns immediately and I'm not entirely sure what the expected behavior is. Is it removing in the background? http://mongoid.org/en/moped/
Travis Reeder
  • 38,611
  • 12
  • 87
  • 87
0
votes
0 answers

Mongoid: filtering an embedded collection by sub-sub-documents multiple fields

I am a beginner in mogo and mongoid. I it possible to filter sub-documents collection by a sub-sub-documents multiple fields ($elemMatch)? I'm trying to make a parametrized scope for an embedded collection. Set up: class Product include…
0
votes
1 answer

Multiple db queries with RABL and Mongoid/Moped

I have a simple app that uses rabl and mongoid 3.1.0, with this action: # index @products = current_shop.products The rabl code looks like this: # index.json.rabl collection @products extends 'api/products/show' # show.json.rabl object…
Greg Funtusov
  • 1,377
  • 15
  • 18
0
votes
1 answer

rake aborted! The operation: "GET MORE"

I am getting the below error when I run the rake task. Can any one help me? Error rake aborted! The operation: "GET MORE" failed with error "cursor 178700246530 not found" C:/Ruby193/lib/ruby/gems/1.9.1/gems/moped-1.3.2/lib/moped/node.rb:210:in…
Muzaffer
  • 196
  • 1
  • 5
  • 13