Giter Site home page Giter Site logo

Comments (6)

GayathriKaliyamoorthy avatar GayathriKaliyamoorthy commented on August 23, 2024

Currently digest based APIs are not supported. In the next release, we are planning to release the digest based APIs.

from aerospike-client-nodejs.

GayathriKaliyamoorthy avatar GayathriKaliyamoorthy commented on August 23, 2024

Hi,

With the latest release 1.0.26, you can retrieve the digest of a key when you do a client.get(key, callback). Please use the API and give us your feedback.

Thanks.

from aerospike-client-nodejs.

prachaquant avatar prachaquant commented on August 23, 2024

thank you :) I try it asap.

from aerospike-client-nodejs.

prachaquant avatar prachaquant commented on August 23, 2024

I've already try it. but there is some problem I get digest from put and I try to get the record using only digest

var aerospike = require("aerospike");
var client = aerospike.client(
{
    hosts: [
        {
            addr: "127.0.0.1",
            port: 3000
        }]
}).connect(function(err)
{
    if (err.code !== 0) console.log(err);
});

client.put(aerospike.key('test', 'test', '1'),{1: 1}, function(err, key)
{
    var digest = key.digest;
    console.log(digest);

    client.get(
    {
        ns: 'test',
        set: 'test',
        digest: digest
    }, function()
    {
        console.log(arguments);
    });
});

I got this error:

<Buffer 97 bd 2d 33 c6 2f e4 1c c8 39 b2 dd 98 0b d7 2d 12 b6 85 14>
Jan 13 2015 08:27:40 GMT: ERROR(30420) [get.cc:103] [prepare] - Parsing of key (C structure) from key object failed
{ '0': 
   { code: -2,
     message: 'AEROSPIKE_ERR_PARAM',
     func: null,
     file: '../src/main/client/get.cc',
     line: 104 },
  '1': null,
  '2': null,
  '3': null }

from aerospike-client-nodejs.

GayathriKaliyamoorthy avatar GayathriKaliyamoorthy commented on August 23, 2024

Hi,
You can retrieve a digest, but you cannot do any operations based on the digest.

  1. The key object is a dictionary with entries, ns , set and key. So the entry digest is an invalid entry in the sample code above.
  2. For any given key digest is calculated internally using the set value and the key value in the key object.
  3. As we do not expose any digest based APIs, you cannot retrieve using the digest of the key.

If you need digest based APIs for your use case, please let us know, we will prioritize accordingly. And also, if you can explain your use case, we might be able to help you to design it our current API.

from aerospike-client-nodejs.

prachaquant avatar prachaquant commented on August 23, 2024

Digest based APIs might help me a lot. Right now I have a problem that I have to update Aerospike data using Unique ID.
Example:
When receive uid, look into DB find Aerospike key and update that record.
uid, aerospike key
id1, aerospike.key('ns','set','A1,B1,C1')
id2, aerospike.key('ns','set','A1,B1,C1')
id3, aerospike.key('ns','set','A1,B2,C1')
id4, aerospike.key('ns','set','A1,B2,C4')
id3, aerospike.key('ns','set','A1,B2,C3')

if no digest based API I need to store
id1, (A1,B1,C1)
id2, (A1,B1,C1)
....
in order to update target aerospike records

if there are digest based API,
id1, hash1
id2, hash1

which is more space saving because for me (A1,B1,C1) is a very long string

from aerospike-client-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.