How to set Raven-Entity-Name metadata in ravendb

585 views Asked by At

HI Please Help me for RavenDB HTTP Client. I want to store data into Raven-Entity-Name called Log but i am not able to set the metadata in PUT command. How we can set the metadata

$.ajax({
type: "PUT",
url: "http://192.168.0.172:37792/Databases/DMS/docs/Log/"+uuid(),
data: "{ time: '"+(new Date()).toString()+"', description: 'Login', userId: '"+data.Results[0]['@metadata']['@id']+"'}",
success: function(data){console.log(data)},
    crossDomain: true,
    error:function(data){console.log(data)},
    contentType:"application/json"
});
1

There are 1 answers

0
Fitzchak Yitzchaki On

You can set the metadata with the @metadata property name:

@metadata: { 'Raven-Entity-Name': 'Log' }.