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

  • Home
  • SEARCH
  • 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 8579503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:37:13+00:00 2026-06-11T20:37:13+00:00

I am running updates against a database in MongoLab (Heroku) and cannot get information

  • 0

I am running updates against a database in MongoLab (Heroku) and cannot get information from getLastError.

As an example, below are statements to update a collection in a MongoDB database running locally in my machine (db version v2.0.3-rc1).

ariels-MacBook:mongodb ariel$ mongo
MongoDB shell version: 2.0.3-rc1
connecting to: test
> db.mycoll.insert({'key': '1','data': 'somevalue'});
> db.mycoll.find();
{ "_id" : ObjectId("505bcc5783cdc9e90ffcddd8"), "key" : "1", "data" : "somevalue" }
> db.mycoll.update({'key': '1'},{$set: {'data': 'anothervalue'}});
> db.runCommand('getlasterror');
{
    "updatedExisting" : true,
    "n" : 1,
    "connectionId" : 4,
    "err" : null,
    "ok" : 1
}
> 

All is well locally.

Now I switch to a database in MongoLab and run the same statements to update a document. getLastError is not returning an updatedExisting field. Hence, I am unable to test if my update was successful or otherwise.

ariels-MacBook:mongodb ariel$ mongo ds0000000.mongolab.com:00000/heroku_app00000 -u someuser -p somepassword
MongoDB shell version: 2.0.3-rc1
connecting to: ds000000.mongolab.com:00000/heroku_app00000
> db.mycoll.insert({'key': '1','data': 'somevalue'});
> db.mycoll.find();
{ "_id" : ObjectId("505bcf9b2421140a6b8490dd"), "key" : "1", "data" : "somevalue" }
> db.mycoll.update({'key': '1'},{$set: {'data': 'anothervalue'}});
> db.runCommand('getlasterror');
{
    "n" : 0,
    "lastOp" : NumberLong("5790450143685771265"),
    "connectionId" : 1097505,
    "err" : null,
    "ok" : 1
}
> db.mycoll.find();
{ "_id" : ObjectId("505bcf9b2421140a6b8490dd"), "data" : "anothervalue", "key" : "1" }
>

Did anyone run into this?
If it matters, my resource at MongoLab is running mongod v2.0.7 (my shell is 2.0.3).
Not exactly sure what I am missing.
I am waiting to hear from their support (I will post here when I hear back) but wanted to check with you fine folks here as well just in case.
Thank you.

  • 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-11T20:37:15+00:00Added an answer on June 11, 2026 at 8:37 pm

    This looks to be a limitation of not having admin privileges to the mongod process. You might file a ticket with 10gen as it doesn’t seem like a necessary limitation.

    When I run Mongo in auth mode on my laptop I need to authenticate as a user in the admin database in order to see an “n” other than 0 or the “updatedExisting” field. When I authenticate as a user in any other database I get similar results to what you’re seeing in MongoLab production.

    (Full disclosure: I work for MongoLab. As a side note, I don’t see the support ticket you mention in our system. We’d be happy to work with you directly if you’d like. You can reach us at support@mongolab.com or http://support.mongolab.com)

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

Sidebar

Related Questions

After running a insert or update query against a SQLServer 2005 database, under what
I'm running the following code to update the database according to the data I
I have a SQL update statement I am running from inside a PHP program.
[ See updates at bottom ] I'm using JDBC to run statements against SQL
I made the error of running what should have been a quick update against
I'm getting an error when running the following SQL against oracle 10g (10.2.0.1.0): UPDATE
My application uses GPS updates while it is running and I would like that
I running schema update for Symfony2 gives: Warning: class_parents(): Class Tg\UserBunde\Entity\Person does not exist
I'm running a scene update handler to increase the scale of my sprite while
Running a query which should return all open questions along with the last update

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.