Questions tagged [dbref]

mongodb - Database references

DBRefs (MongoDB) are references from one document to another using the value of the first document’s _id field, collection name, and, optionally, its database name. By including these names, DBRefs allow documents located in multiple collections to be more easily linked with documents from a single collection. (Database references[MongoDB])

117 questions
0
votes
1 answer

How can I make DBRefs with MongoDB Ruby Driver 2?

I have noticed, with surprise, that in the new version of MongoDB Ruby Driver, BSON::DBRef has disappeared. Given that MongoDB's website still states that the Ruby Driver supports DBRefs I imagine that only the mode of accessing DBRefs has changed.…
retrography
  • 6,302
  • 3
  • 22
  • 32
0
votes
1 answer

search by param values of referenced objects in mongodb

Is it possible to search based on some param value of a DBRef object in spring data. eg. say we have two objects, Car, and Company as shown Class Car { @Id String id; String model; @DBRef Company company; } Class Company { @Id …
shailesh
  • 763
  • 2
  • 9
  • 23
0
votes
1 answer

Populating array of ObjectId's in Mongoose 3.8

I'm trying populate an array with entire information of another collection and I can't get it. I have 2 collections: users and exams and I want to show a json response containing user information and exams buyed by the user. My problem is that I…
dpbataller
  • 1,197
  • 4
  • 12
  • 23
0
votes
1 answer

MongoDB - PHP manual references approach suitability

MongoDB newbie here. I'm having the first approach on references, and my main doubt is if i'am using the appropriate strategy(manual references) for my situation. Working on 2 collections(user, message) in the same db, lets make an example of a…
lese
  • 539
  • 1
  • 5
  • 24
0
votes
1 answer

Mongodump using DBRef criteria and indexes?

I want to dump some part of a database, especially some part of a collection using the -q / --query option. Here is what I'm doing: mongodump --host ... -o ... -q "{ pipe: DBRef(\"pipe\", ObjectId($2)) }" The dump is operating but is strongly slow.…
user2619608
  • 111
  • 1
  • 3
0
votes
1 answer

MongoDB DBRef handling inside GWT's RequestFactory function call

I have question related to DBRef of MongoDB. Imagine this scenario: Group{ ... "members" : [ { "$ref" : "User", "$id" : ObjectId("505857a4e4b5541060863061") }, { …
Elkhan Dadashov
  • 2,417
  • 1
  • 13
  • 5
0
votes
1 answer

Updating nested emdedded list containing BasicDBObject to DBRef in mongoDB using groovy

The structure of document in mongo is as follows Project(@Entity) |--Deliverables(@Embedded, list inside Project) |--DeliveryTypes(@Embedded, list inside Deliverables) |--DeliveryItems(Plain list inside DeliveryTypes) …
Pazuzu
  • 23
  • 7
0
votes
1 answer

mongoDB DBRef as Foreign Key Test - Query

since mongoDB does not support foreign keys, I've read that you can use for DBReF. Now I want to like to test this relationship. The 2 collections are db.professor.insert({"_id": 1122, "Name":"Heinrich","Rang":…
viv1d
  • 339
  • 4
  • 5
  • 12
0
votes
1 answer

Mongodb java - how to query for particular reference id value

I have two collections checkone {"_id":1,"name":"alex"}, {"_id":2,"name":"sandy"} checktwo {"_id":11,"password":"alex",tenant_id:{$ref:"checkone","$id":1}} {"_id":12,"password":"alex",tenant_id:{$ref:"checkone","$id":2}} I am…
Jessie
  • 963
  • 5
  • 16
  • 26
0
votes
1 answer

Mongo / Mongoose How to extend a DBRef

Let's say there is a multiplayer game defined as such: var GameSchema = new Schema({ players : {type : [Schema.ObjectID], ref : 'User', required : true} }); I am wondering what would be the best way to store the score for each user,…
Gregory M
  • 494
  • 1
  • 4
  • 11
-1
votes
1 answer

How to use SearchFilter using a dbRef with Api_Platform?

When I have a document property using a dbRef - relation like this: /** * @MongoDB\ReferenceOne ( * discriminatorMap={ * "post"=Post::class * }, * defaultDiscriminatorValue="post", * storeAs="dbRef", * …
Timor Kodal
  • 324
  • 3
  • 7
-1
votes
2 answers

Difference between embedded and dbRef fields while building search query in MongoDB

Here I have the object having two fields, one is embedded and the other is DbRef in mongoDB collection. Suppose the object have the embedded field named product and the DbRef field named company. If I want to search the object having the value "ABC"…
Minal Shah
  • 1,402
  • 1
  • 5
  • 13
1 2 3 4 5 6 7
8