Re: [RavenDB] Partial document updates using the Patching API Error

75 views
Skip to first unread message

Oren Eini (Ayende Rahien)

unread,
Aug 11, 2012, 1:06:03 PM8/11/12
to rav...@googlegroups.com
What build are you using?


On Sat, Aug 11, 2012 at 8:54 AM, Mohammad Naveed <renoxp...@gmail.com> wrote:
Hi. I am getting this error "Object serialized to String. RavenJObject instance expected." when i try to update using the patch api. Even tho i follow the exact code mentioned on the raven website.

Here is my code:
session.Advanced.DatabaseCommands.Patch(
        "workers/65",
        new[]
                    {
                        new Raven.Abstractions.Data.PatchRequest
                            {
                                Type =Raven.Abstractions.Data.PatchCommandType.Set,
                                Name = "Nationality",
                                Value = Raven.Json.Linq.RavenJObject.FromObject("Sweden")
                            }
                    });

Here is the code on ravendb website i followed http://ravendb.net/docs/client-api/partial-document-updates:
documentStore.DatabaseCommands.Patch(
    "blogposts/1234",
    new[]
                    {
                        new PatchRequest
                            {
                                Type = PatchCommandType.Set,
                                Name = "Title",
                                Value = RavenJObject.FromObject("New title")
                            }
                    });


What could be the problem?

Oren Eini (Ayende Rahien)

unread,
Dec 12, 2012, 10:39:03 AM12/12/12
to rav...@googlegroups.com
Just set the value to the string directly, what happens then?

On Wed, Dec 12, 2012 at 12:34 PM, MisterDr <djena...@gmail.com> wrote:
I have that problem with latest build. #992
Reply all
Reply to author
Forward
0 new messages