Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8259509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:52:53+00:00 2026-06-08T02:52:53+00:00

I have an application that performs fast operations on in-memory data. This data is

  • 0

I have an application that performs fast operations on in-memory data. This data is represented in memory as a Dictionary<MyKey,MyData>. The MyKey is a class that contains a few string tags:

public class MyKey
{
    string tag1;
    string tag2;
    ... 
}

and MyData is an object that contains some texts.

I would like to store it in MongoDB as a collection of documents like:

{
    tag1: "foo1",
    tag2: "foo2",
    mydata: { ... }
},
{
    tag1: "bar1",
    tag2: "bar2",
    mydata: { ... }
}...

so that I can use mongodb selectors:

db.MyCollection.find({tag1: "foo1"})

But then it becomes really annoying to write the serializer / deserializer, since a one-to-one mapping would do:

{
    mykey: { tag1: "foo1", tag2: "foo2"},
    mydata: { ... }
}

I feel like this is a pretty common issue. What is the best solution to achieve this?
I want to keep the original Dictionary structure but I don’t want to reinvent the wheel for the Serializer.

Any idea / tutorial I could follow?
Is this even something I should be doing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:52:54+00:00Added an answer on June 8, 2026 at 2:52 am

    There’s no issue with document of this form:

    {
        mykey: { tag1: "foo1", tag2: "foo2"},
        mydata: { ... }
    }
    

    You can still query it.

    db.collection.find({'mykey.tag1': 'foo1'})
    

    Does this answer your question? Is there another particular reason for wanting that document structure?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that performs some operations on a set of data. The
I have a Windows Forms ClickOnce application that performs its own application updates. This
I have an application that performs HTTP posts at regular intervals (data retrieved from
We have an application that performs comparisons on data objects to determine if one
I have a simple Swing Java application that performs searches, and the results are
I am building a Rails application that contains Developer s who have Application s.
I have an application that goes like this F5 load balancer - IHS(a&b) -
We have an application that performs auto-updates. Until recently, we haven't run into any
I have an application written in Java that performs some straightforward but time consuming
I have a simple little application that performs some analysis of all our corporate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.