DocumentStore.Changes().ForAllDocuments().Subscribe() - Not possible to get full id?

24 views
Skip to first unread message

Alan Ciantar

unread,
Jul 8, 2014, 9:27:49 AM7/8/14
to rav...@googlegroups.com
Scenario: If any document is deleted (any collection type), if it has X class, I want to do something with it.

I was trying to do something along the lines of:

if (documentChangeNotification.Type == DocumentChangeTypes.Delete) {
   
var baseObject = documentSession.Load<IBaseObject>(documentChangeNotification.Id)
}

But Id only contains the number (i.e 100 out of SampleData/100).
Is it not possible to get the full id?

Alan Ciantar

unread,
Jul 8, 2014, 9:29:50 AM7/8/14
to rav...@googlegroups.com
Would it even load the item given the correct id seeing as its gone from studio for the time being?
Is what I'm trying to do possible?

Alan Ciantar

unread,
Jul 8, 2014, 9:32:41 AM7/8/14
to rav...@googlegroups.com
Should of said: I know about the listeners; was trying to do this when deleting from studio.

Oren Eini (Ayende Rahien)

unread,
Jul 8, 2014, 9:35:36 AM7/8/14
to ravendb
You get the FULL id from the sbuscription.

Please note that when you call delete, by the time you are called, the _document has already been deleted_.



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811





--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" 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/d/optout.

Alan Ciantar

unread,
Jul 8, 2014, 9:38:20 AM7/8/14
to rav...@googlegroups.com
Aye, I pretty much figured that out now I guess.

And uhh, unless I did something wrong, I deleted "section/5535" and only got "5535" as the Id.

Oren Eini (Ayende Rahien)

unread,
Jul 8, 2014, 9:40:20 AM7/8/14
to ravendb
that isn't really supposed to happen, no.
Can you create a failing test?



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811





On Tue, Jul 8, 2014 at 4:38 PM, Alan Ciantar <alan.c...@casasoft.com.mt> wrote:
Aye, I pretty much figured that out now I guess.

And uhh, unless I did something wrong, I deleted "section/5535" and only got "5535" as the Id.

--
Reply all
Reply to author
Forward
0 new messages