Questions tagged [multikey]

73 questions
0
votes
0 answers

Commons MultiKeyMap vs nested HashMaps

I have to associate an Object to a n keys, such as --> . I am considering using Commons MultiKeyMap or nesting HashMaps (such as Map>>). Question: I was wondering which alternative generates the least memory overhead. Note: I…
k88074
  • 1,742
  • 2
  • 24
  • 39
0
votes
2 answers

Used Multikey(1,2,3) to store entries in Map. Now only have (1) . Can I retrieve all the entries that have (1) in the Multikeys?

I've inserted values into a Map using Multikey with 3 params. Now I would like to retrieve all the entries that have a specific key in their Multikey -and I've no idea as to values of the other 2 .. map.put(new MultiKey(valueA,valueB,valueC),…
akapulko2020
  • 1,001
  • 2
  • 19
  • 34
0
votes
2 answers

Java: Map with doubleKey type, how to make the right hashCode()?

I have a MultiKey object as keys for a Map. A Key consists of a Name (String) and an ID (int). The following contract has to be fullfilled: Keys have to be equal if either the names of both keys are equal or the ids of both keys. How do I have to…
Jan
  • 1,273
  • 10
  • 23
0
votes
1 answer

mongodb multikey index bounds in arrays of subdocs

For background, the page from the docs that seems most relevant to my question is this page on multikey index bounds and index intersection. I'm having an issue where it seems like mongo is not properly combining index boundaries in an $elemMatch…
underrun
  • 6,177
  • 2
  • 34
  • 48
0
votes
1 answer

Mongodb - Query MultiKey Indexed Documents

My question is about the way MongoDB operates when querying MultiKey document. Assuming I have these documents: { a: 1, b: 2, c: ['x','y','z'] }, { a:3, b: null, c: ['x','z'] } My query is this: db..find({ b: null, c:…
refaelos
  • 7,299
  • 5
  • 34
  • 50
0
votes
3 answers

Pygame multiple keys weird behaviour

I'm making a game with pygame and I encountered a problem with the following code : while not self.end: # main game loop keys = pygame.key.get_pressed() if keys[K_LEFT]: adddirection(LEFT) elif keys[K_RIGHT]: …
Waroulolz
  • 173
  • 7
  • 22
0
votes
1 answer

geospatial index with another multikey index... Any solutions?

I have a collection like below. I want to index "location" and "product_list.id". MongoDB seems to permit only single multi key index in a document. Any work around possible? { "location":[62.99932,71.23424], "product_list":[ …
Joe
  • 3
  • 1
0
votes
1 answer

Moving MongoDB to Multikeys but indexOnly is returning false

What I'm trying to do sounds logical to me however I'm not sure. I am trying to improve part of a MongoDB collection by using Multikeys. For example: I have multiple documents with the following format: Document: { "_id":…
Levi Roberts
  • 1,160
  • 3
  • 18
  • 42
0
votes
1 answer

Collection data modeling in mongoDB

I want to design a model for profiles interaction, for example A <-> interact <-> B , the interaction contains common fields for A and B. Lets say I have collection called Interactions, I have few thoughts in mind and I am looking for the best…
assaf_miz84
  • 667
  • 14
  • 30
0
votes
1 answer

Mongo sort by multiple fields in a nested array

I have a mongo collection with documents like- { _id : 1abc, 'data' :'blah', 'createdDate' : ISODate("2013-05-26T01:34:10Z"), 'a': [ { _id : a1adas, 'createdDate' : ISODate("2013-05-26T01:35:10Z"), 'b':[ …
Anand Hemmige
  • 3,083
  • 5
  • 18
  • 31
0
votes
1 answer

How to read multikey index values in MongoDB?

I would like to have autocomplete feature that suggests keywords from database. If I use MongoDB and multikey index, I kind of already have these keywords in database, but can I access them somehow? If I have following object in collection: { …
user1466082
  • 53
  • 1
  • 3
0
votes
1 answer

Multi-Field Primary Key

For reasons I cannot understand, the people who supply my tables do not have any form of single field unique identification for the 20k+ entries in their tables. I have two fields, BuildingCode and RoomCode, which together make up a unique room. For…
StuckAtWork
  • 1,585
  • 7
  • 22
  • 36
-2
votes
2 answers

How to create and populate a nested dictionary with three keys

I have a unique double corresponding to a variation of three strings. I want to populate a dictionary or something such that I can call something like dict[key1][key2][key3] and get the value. I've tried a whole bunch of things like …
Charles Clayton
  • 13,212
  • 10
  • 73
  • 114
1 2 3 4
5