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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:18:07+00:00 2026-05-31T07:18:07+00:00

I’ve been looking into building a REST api using the Azure SDK for node

  • 0

I’ve been looking into building a REST api using the Azure SDK for node (https://github.com/WindowsAzure/azure-sdk-for-node). I have a simple MessageTable in Azure tablestore – the PartitionKey is a device identifier (messages belong to a specific messaging device) and the RowKey is a number that identifies the message.

The problem is that the RowKey is a very big number which usually ends with a load of 9’s (it’s a ‘reverse-timestamp’), and the node-azure library is rounding this number up when data is returned. See example JSON response below:

{
"id":"http://xxx.table.core.windows.net/MessageTable(PartitionKey='12345',RowKey='2520801590159999999')",
"link":"MessageTable(PartitionKey='12345',RowKey='2520801590159999999')",
"updated":"2012-03-13T15:53:34Z",
"etag":"W/\"datetime'2011-11-24T13%3A36%3A41.9555578Z'\"",
"PartitionKey":12345,
"RowKey":2520801590160000000,
"Timestamp":"2011-11-24T13:36:41.955Z",
...other results removed for brevity
}

The “id” and “link” elements show the correct RowKey of 2520801590159999999; the “RowKey” element shows a rounded version of this: 2520801590160000000.

Anyone know what’s going on?

I’ve also logged this question – I’m sure it’s the same root cause:
https://stackoverflow.com/questions/9683515/journey-routing-fails-due-to-number-rounding

Edit @smarx:
Test code reproduced below. When running, going to http://localhost:8080/devices/12345/messages gives the json output sampled above. Azure table is MessageTable, partition key is deviceId (12345), rowkey is messageId (2520801590159999999).

var express = require('express');
var http = require('http');
var azure = require('azure');
var uuid = require('node-uuid');
var tableService = azure.createTableService( '[ACCOUNT_NAME]', '[ACCOUNT_KEY]' );
var app = module.exports = express.createServer();

app.configure(function(){
  app.use(app.router);
});

app.configure('development', function(){
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); 
});

app.configure('production', function(){
  app.use(express.errorHandler()); 
});

app.get('/devices/:deviceId/messages', function ( req, res ) {
  var query = azure.TableQuery
    .select()
    .top( 30 )
    .from( "MessageTable" )
    .where( 'PartitionKey eq ?', req.params.deviceId );

  tableService.queryEntities( query, function (error, entities) {
    if ( null != error ) {
      res.end('Could not query MessagesTable: ' + error.code);
      return;
    }
    res.send( entities );
  });
});

app.listen(8080);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);

[EDIT by @smarx]:

Simpler repro:

tableService.createTableIfNotExists('testtable', function () {
  tableService.insertEntity('testtable', {
    PartitionKey: 'pkey',
    RowKey: '2520801590159999999'
  }, function () {
    tableService.queryEntity('testtable', 'pkey', '2520801590159999999', function (error, entity) {
      console.log(entity.RowKey); // prints 2520801590160000000
    });
  });
});
  • 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-31T07:18:08+00:00Added an answer on May 31, 2026 at 7:18 am

    This is a bug here: https://github.com/WindowsAzure/azure-sdk-for-node/blob/master/lib/util/atomhandler.js.

    The implementation of parse (by default) tries to guess the type of a property value if none is specified, which I don’t believe is the correct behavior. (The lack of a type means to use the default, which is string.)

    I’ve filed a bug (https://github.com/WindowsAzure/azure-sdk-for-node/issues/114), including a suggested fix. You can try it yourself by just adding convertTypes = false at the top of the parse function.

    Edit: This has now been fixed in the repo. (Click on the GitHub issue link above to see.)

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from

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.