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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:47:39+00:00 2026-06-05T08:47:39+00:00

The mongoDB API documentation seems to be lacking in this area. I am trying

  • 0

The mongoDB API documentation seems to be lacking in this area. I am trying to use the aggregate function to get a count of popular tags in a certain collection. Here is the command I wish to execute:

db.runCommand(
       { aggregate : "articles", 
         pipeline : [ { $unwind : "$Tags" }, 
                      { $group : { _id : "$Tags", count : { $sum : 1 } }
                      } ]});

When I execute this using the shell, I get the following:

{
    "result": [{
        "_id": "2012",
        "count": 3
    }, {
        "_id": "seattle",
        "count": 5
    }],
    "ok": 1
}

I’m using c# 4.0, so I guess I would prefer to get this back as a dynamic object, but I’ll take whatever I can get…

FWIW, I am using mongoDB for Windows, 32 bit, v2.1.1 (Nightly)

  • 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-05T08:47:41+00:00Added an answer on June 5, 2026 at 8:47 am

    Here’s the corresponding C# Driver Doc page: RunCommand(). So basically you call Database.RunCommand("MyCommand"). This ticket in JIRA may come handy for an example of more complex commands requiring (multiple) properties: CSHARP-478

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

Sidebar

Related Questions

I am trying to execute mongo mapreduce commands via the java api - com.mongodb.MapReduceCommand
I am creating an API using PHP and MongoDB. In this system I got
The official MongoDB api wrote very little about $ne http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24ne So when I encountered
I'm writing some Java code using MongoDB with Java API and I'm unsure of
I have a problem to Store file (from a remote API) in MongoDB, i'm
I am using java with the twitter search api to store tweets in mongoDB,
MongoDB for C#, I started following their tutorial but the compile error I get
In mongodb, while I run command to get distinct record from collection, It returns
I am evaluating MongoDB as a storage solution for our financial/accounting RESTful API. I
I am trying to perform a regex query using PyMongo against a MongoDB server.

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.