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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:12:04+00:00 2026-05-23T10:12:04+00:00

I am creating one application where for every product I have one database and

  • 0

I am creating one application where for every product I have one database and I will create different document based on date. The keys in documents could be different and depend upon user, what he provides. Assumption is user will keep giving same key for tracking with changed value over time. In the end, I need to know all possible keys before creating automatic views on them.

Example:
If I had DB, say, test. It contains, say, two documents,

1. {
 "_id":"1",
 "_rev":"1-"
 "type": "Note",
 "content": "Hello World!"
}

2. {
 "_id":"2",
 "_rev":"1-"
 "type": "Note",
 "content": "Beyond Hello World!",
 "extra":"Boom"
}

Then I want to list all keys in this DB. So, answer should be _id,_rev,type,content and extra.

These keys are dynamic and depend upon users. So, I couldn’t assume that I knew them in advance.

  • 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-23T10:12:05+00:00Added an answer on May 23, 2026 at 10:12 am

    I have never used stackoverflow before, I saw your question when trying to solve this problem myself so I have signed up. I think this solves your problem:

    create a view where “views” includes this:

    {
    “keys”: {
    “map”: “function(doc) { for (var thing in doc) { emit(thing,1); } }”,
    “reduce”: “function(key,values) { return sum(values); }”
    }
    }

    then query on that view with group=true e.g.:

    http://localhost:5984/mydb/_design/myview/_view/keys?group=true

    you should get back a list of all the keys in your database and a count of how often the occur.

    does this help?

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

Sidebar

Related Questions

In my application, I am querying database with same sql every one second. I
When creating an Android application using Loaders, should every activity and fragment have its
I'm creating a modular desktop application with agile licensing in a database. I have
I'm working on creating a self updating application and one issue I'm running into
I'm creating an iPad application which needs a UIPopoverController like this one (I mean,
I am creating an application for the iPhone which involves having more than one
I am creating a tabbar application. One of the tabs is for an rss
I've been playing around with creating an application using the S#arp Architecture . One
I am creating one GUI in swing Java. I have to use one button
We have a mid-size SQL Server based application that has no indexes defined. Not

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.