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 6182219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:09:44+00:00 2026-05-24T01:09:44+00:00

So I am working on a pet project where I’m storing various text files.

  • 0

So I am working on a pet project where I’m storing various text files. I have setup my app to save the tags as a string in one of my collections so an example would be:

tags: “Linux Apache WSGI”

Storing them and searching for them work just fine but my question comes when I want to do something like a tag cloud, count all the various tags, or make a dynamic selection system based on tags, what is the best way to break them up to work with? Or should I be storing them some other way?

Logically I could scan through every record and get all the tags, break them based on space, then cache the result somehow. Maybe that’s the right answer but I wanted to ask the community wisdom.

I’m using pymongo to interact with my database.

  • 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-05-24T01:09:44+00:00Added an answer on May 24, 2026 at 1:09 am

    Or should I be storing them some other way?

    The standard way to store tags is to store them as an array. In your case, the DB would look something like:

    tags: ['linux', 'apached', 'wsgi']
    

    … what is the best way to break them up to work with?

    This is what Map/Reduce is designed for. This effectively “scans every record”. The output of a Map/Reduce is another collection that you can query.

    However, there’s also another way to do this and that’s to keep “counters” and update them. So when you save a new document you also increment all of the tags related to that document.

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

Sidebar

Related Questions

I have a pet project that I'm working on that has multiple worker threads.
I'm currently working on a pet project and need to do C++ development on
I'm using castle windsor for a pet-project I'm working on. I'm starting to notice
Working on a project at the moment and we have to implement soft deletion
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
I am working on a pet project and am at the research stage. Quick
Today I'm working on a pet project using chained function calls, and I'm curious
I'm completely new to JQuery and MVC. I'm working on a pet project that
I'm currently working on a (rather large) pet project of mine , a Swing
I've been working on a pet project on the weekends to learn more about

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.