Issue changing type of Id from Guid to string

20 views
Skip to first unread message

Alexander Zeitler

unread,
Aug 21, 2012, 8:04:59 AM8/21/12
to rav...@googlegroups.com

Hi,

 

I had documents having Guid Ids.

Then I changed the Ids to be type of string and did a clean/rebuild.

I deleted all old documents from the database collection (910).

After creating a new document, it’s Id is still a Guid.

 

Then I created a new database and tried to persist the new document there – the Id is still a Guid.

If I create a new type with a string based Id, everything works fine.

 

What am I doing wrong? (I know I can change the metadata, but do have to change the meta also for a new database created from scratch)?

 

Alex

 

Alexander Zeitler

unread,
Aug 21, 2012, 8:30:54 AM8/21/12
to rav...@googlegroups.com

Interesting behavior:

If the Id is NULL, it gets assigned a HiLo Id.

If the Id is String.Empty, it gets assigned a Guid Id.

Oren Eini (Ayende Rahien)

unread,
Aug 21, 2012, 8:44:45 AM8/21/12
to rav...@googlegroups.com
Yes, that makes sense, that is the intended behavior.
Reply all
Reply to author
Forward
0 new messages