Re: Document Id with '+' character can't be loaded

66 views
Skip to first unread message

jo...@thesimonshouse.com

unread,
May 2, 2013, 1:45:50 AM5/2/13
to rav...@googlegroups.com
I've just tried to encode the Id as this SO answer suggests but still doesn't work!

On Thursday, 2 May 2013 14:28:43 UTC+10, jo...@thesimonshouse.com wrote:
Using:  Build 2261, Version 2.0.0 / 76f3b74

We use as the ID for our docs the Type.FullName + some unique identifier.

The problem seems that if we have a nested class then the ID will have a '+' sign, eg: VideoStore.Sales.ProcessOrderSaga+OrderData

When we create the document it all works file because it is a POST (see Request #7 below).
But then if we try to Load the document by ID (see Request #8) we get null!

If I remove the '+' character (see Request #10 and 11) then it works as expected.

Here is the log from the server:
Request #   7: POST    -    58 ms - <system>   - 200 - /bulk_docs
        PUT VideoStore.Sales.ProcessOrderSaga+OrderData/OrderNumber/3842cac4-b9a0-8223-0dcc-509a6f75849b
Request #   8: GET     -     0 ms - <system>   - 200 - /queries/?include=SagaDocId&id=VideoStore.Sales.ProcessOrderSaga+OrderData/OrderNumber/3842cac4-b9a0-8223-0dcc-509a6f75849b
Request #   9: GET     -     0 ms - <system>   - 404 - /docs/Raven/Replication/Destinations
Request #  10: POST    -    47 ms - <system>   - 200 - /bulk_docs
        PUT VideoStore.Sales.OrderData/OrderNumber/3842cac4-b9a0-8223-0dcc-509a6f75849b
Request #  11: GET     -     1 ms - <system>   - 200 - /queries/?include=SagaDocId&id=VideoStore.Sales.OrderData/OrderNumber/3842cac4-b9a0-8223-0dcc-509a6f75849b

Is there any known issue with using '+' as part of the id for a documents?

Fitzchak Yitzchaki

unread,
May 2, 2013, 3:02:56 AM5/2/13
to <ravendb@googlegroups.com>
This should work. Can you create a failing test?


--
You received this message because you are subscribed to the Google Groups "ravendb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jo...@thesimonshouse.com

unread,
May 3, 2013, 12:18:08 AM5/3/13
to rav...@googlegroups.com
Unit test created and sent to support.
Here is the gist anyway:

Oren Eini (Ayende Rahien)

unread,
May 3, 2013, 2:51:00 AM5/3/13
to ravendb
Thanks for the unit test, it really helped.
Will be fixed in the next build.

jo...@thesimonshouse.com

unread,
May 3, 2013, 2:54:33 AM5/3/13
to rav...@googlegroups.com
Quick question kind of related.

Are there any restrictions on characters that are not allowed to be set as an ID?

I guess, should I always encode the id that I'm about to assign to a doc?

Oren Eini (Ayende Rahien)

unread,
May 3, 2013, 3:08:06 AM5/3/13
to ravendb
It can't end with an /, but that is about it.

Mircea Chirea

unread,
May 3, 2013, 4:11:55 AM5/3/13
to rav...@googlegroups.com
As Oren says it can't end with a slash; if it does you'll get a sequential index appended to it.

Kijana Woodard

unread,
May 3, 2013, 8:31:43 AM5/3/13
to rav...@googlegroups.com

Can't start with / either right? I think I hit that recently in 2330 for a moment due to a bug in my code building the id.

Oren Eini (Ayende Rahien)

unread,
May 3, 2013, 2:11:56 PM5/3/13
to ravendb
Hm, no, it can't. 
Reply all
Reply to author
Forward
0 new messages