node.js odata-server mongodb unable to post related entity -


i have been working on node.js odata server based on example: how set nodejs odata endpoint odata-server

i have working... can read, update, insert, delete. trying associate journal tasks , having problems.

i have tried several different ways outlined here: operations (odata version 2.0)

here code:

/* global $data */ require('odata-server');  $data.class.define("task", $data.entity, null, {     id: { type: "id", key: true, computed: true, nullable: false },     title: { type: "string", required: true, maxlength: 200 },     journals: { type: "array", elementtype: "journal"         , inverseproperty: "task" } });  $data.class.define("journal", $data.entity, null, {     id: { type: "id", key: true, computed: true, nullable: false },     entry: { type: "string" },     dateinserted: { type: "string" },     task: { type: "object", elementtype: "task" , inverseproperty: "journals" } });  $data.entitycontext.extend("obb", {     tasks: { type: $data.entityset, elementtype: task },     journals: { type: $data.entityset, elementtype: journal }    });  $data.createodataserver(obb, '/api-v0.1', 2046, 'localhost'); 

question:

is feature available odata-server post link journal task?

i using fiddler2 , composing post have tried these urls:

//localhost:2046/api-v0.1/tasks('the-id-of-a-task')/journals //localhost:2046/api-v0.1/tasks('the-id-of-a-task')/journals/$link 

post body's have tried:

{"entry":"this test"} {"url":"http://localhost:2046/api-v0.1/journals('id-of-a-journal-in-the-db')"} 

i have tried build out , post task journals , didn't work.

any appreciated. thanks.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -