Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Does document exist?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 30 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
slav  
View profile  
 More options Jul 29 2010, 3:30 pm
From: slav <slav....@gmail.com>
Date: Thu, 29 Jul 2010 12:30:07 -0700 (PDT)
Local: Thurs, Jul 29 2010 3:30 pm
Subject: Does document exist?
This is probably a simple thing, but I can't figure it out.

Is there an easy way to check that a document exists by document ID
without actually loading it? Create an index by id and query it?

On a side note, how would I create an index by document id? I need to
index by metadata, right? I've seen discussion, but not concrete
example.

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ayende Rahien  
View profile  
 More options Jul 29 2010, 4:06 pm
From: Ayende Rahien <aye...@ayende.com>
Date: Thu, 29 Jul 2010 23:06:10 +0300
Local: Thurs, Jul 29 2010 4:06 pm
Subject: Re: [RavenDB] Does document exist?

Huh?
Why not just session.Load<...>("doc/id") != null


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Cazzulino  
View profile  
 More options Jul 29 2010, 4:07 pm
From: Daniel Cazzulino <dan...@cazzulino.com>
Date: Thu, 29 Jul 2010 17:07:54 -0300
Local: Thurs, Jul 29 2010 4:07 pm
Subject: Re: [RavenDB] Does document exist?

> without actually loading it

;)

/kzu

--
Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1
425.329.3471


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ayende Rahien  
View profile  
 More options Jul 29 2010, 4:10 pm
From: Ayende Rahien <aye...@ayende.com>
Date: Thu, 29 Jul 2010 23:10:26 +0300
Local: Thurs, Jul 29 2010 4:10 pm
Subject: Re: [RavenDB] Does document exist?

What is _the point_.

On Thu, Jul 29, 2010 at 11:07 PM, Daniel Cazzulino <dan...@cazzulino.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Timothy Walters  
View profile  
 More options Jul 29 2010, 7:43 pm
From: Timothy Walters <tim.walt...@gmail.com>
Date: Thu, 29 Jul 2010 16:43:00 -0700 (PDT)
Subject: Re: Does document exist?
I imagine the cost of getting a very large document that we might just
want to apply a PATCH to would be one possible scenario. In this case
we simply want to confirm that the document exists before trying to
patch in a small addition/change.

An example might be a site that has large documents with attachments,
and allows comments. Lets also assume that documents are regularly
moved off to an Archive (maybe a different DB, or different document
type). If someone tries to add a comment, I need to check that it
still exists as Active, and if so patch it there, otherwise patch it
in the Archive. Not the best example, but it demonstrates some need.
Sure you could argue that it's not the best design, or could be worked
around in different ways, but it'd be nice if the system supported an
EXISTS operation, or something.

On Jul 30, 6:10 am, Ayende Rahien <aye...@ayende.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ayende Rahien  
View profile  
 More options Jul 29 2010, 9:04 pm
From: Ayende Rahien <aye...@ayende.com>
Date: Fri, 30 Jul 2010 04:04:11 +0300
Local: Thurs, Jul 29 2010 9:04 pm
Subject: Re: [RavenDB] Re: Does document exist?

HEAD /docs/my_doc_key

On Fri, Jul 30, 2010 at 2:43 AM, Timothy Walters <tim.walt...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Cazzulino  
View profile  
 More options Jul 29 2010, 9:42 pm
From: Daniel Cazzulino <k...@clariusconsulting.net>
Date: Thu, 29 Jul 2010 22:42:09 -0300
Local: Thurs, Jul 29 2010 9:42 pm
Subject: Re: [RavenDB] Re: Does document exist?

Would be nice to have a client api to do the same

from android nexus1

On Jul 29, 2010 10:04 PM, "Ayende Rahien" <aye...@ayende.com> wrote:

dan...@cazzulino.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
slav  
View profile  
 More options Jul 29 2010, 9:52 pm
From: slav <slav....@gmail.com>
Date: Thu, 29 Jul 2010 18:52:35 -0700 (PDT)
Local: Thurs, Jul 29 2010 9:52 pm
Subject: Re: Does document exist?
In my specific case orders come into my system from 3rd party. Each
order must have unique ID. If I save all orders before forwarding them
to be handled somewhere else.
In theory order with the same ID should come in only once. In practice
if it comes in again I need to notify the 3rd party so that they could
look into it.
So, each time an order comes in, I'll try to load it to see if it
exists. Most of the time I'll get null and things will go normal.

It doesn't really matter in this case if there's no way to check for
the doc existence by ID. Most of the time I won't be loading the
document anyway so no overhead.
I was just curious, since I'm still learning the system.

By the way, "HEAD /docs/my_doc_key" ? Is HEAD an HTTP operation? I
don't see it on the list (http://ravendb.net/documentation/docs-http-
api-index)

On Jul 29, 4:10 pm, Ayende Rahien <aye...@ayende.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ayende Rahien  
View profile  
 More options Jul 30 2010, 3:57 am
From: Ayende Rahien <aye...@ayende.com>
Date: Fri, 30 Jul 2010 10:57:07 +0300
Local: Fri, Jul 30 2010 3:57 am
Subject: Re: [RavenDB] Re: Does document exist?

HEAD is the equivalent of GET, it does the same thing, but return only the
headers.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 25 2011, 5:01 am
From: Damian Hickey <dhic...@gmail.com>
Date: Sun, 25 Dec 2011 02:01:51 -0800 (PST)
Local: Sun, Dec 25 2011 5:01 am
Subject: Re: [RavenDB] Re: Does document exist?

(Sorry for bumping an old thread but couldn't find a more recent discussion)

Is this funtionality exposed via the Client API?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Dec 25 2011, 5:09 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Sun, 25 Dec 2011 12:09:35 +0200
Local: Sun, Dec 25 2011 5:09 am
Subject: Re: [RavenDB] Re: Does document exist?

No, it isn't.
You can just call DatabaseDocuments.Get and see if you have null or not,
instead.
Or send us a pull request.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 25 2011, 6:45 am
From: Damian Hickey <dhic...@gmail.com>
Date: Sun, 25 Dec 2011 03:45:45 -0800 (PST)
Local: Sun, Dec 25 2011 6:45 am
Subject: Re: [RavenDB] Re: Does document exist?

Cheers for the quick response.

> Or send us a pull request

I will examine the API\Code and come back with a proposal.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 5:16 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 02:16:29 -0800 (PST)
Local: Tues, Dec 27 2011 5:16 am
Subject: Re: [RavenDB] Re: Does document exist?

> You can just call DatabaseDocuments.Get

Did you mean IDatabaseCommands.Get()?

If so, I propose adding:

bool IDatabaseCommands.Exists()

If you think this is reasonable, I can proceed with attempt at implementing.

(I think I replied to you directly by accident)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Itamar Syn-Hershko  
View profile  
 More options Dec 27 2011, 5:17 am
From: Itamar Syn-Hershko <ita...@hibernatingrhinos.com>
Date: Tue, 27 Dec 2011 12:17:43 +0200
Local: Tues, Dec 27 2011 5:17 am
Subject: Re: [RavenDB] Re: Does document exist?

store.DatabaseCommands.Get

It can all be done using a simple extension method...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 5:20 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 02:20:10 -0800 (PST)
Local: Tues, Dec 27 2011 5:20 am
Subject: Re: [RavenDB] Re: Does document exist?

Without loading the document?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Itamar Syn-Hershko  
View profile  
 More options Dec 27 2011, 5:25 am
From: Itamar Syn-Hershko <ita...@hibernatingrhinos.com>
Date: Tue, 27 Dec 2011 12:25:57 +0200
Local: Tues, Dec 27 2011 5:25 am
Subject: Re: [RavenDB] Re: Does document exist?

No, it will load the doc

You want to implement a Head() method then, which will return the etag or
null if it doesn't exist. Better than Exists() IMO


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 5:32 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 02:32:31 -0800 (PST)
Local: Tues, Dec 27 2011 5:32 am
Subject: Re: [RavenDB] Re: Does document exist?

Ok will do it that way. Can do an 'Exists' extension method over that.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 5:36 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 02:36:14 -0800 (PST)
Local: Tues, Dec 27 2011 5:36 am
Subject: Re: [RavenDB] Re: Does document exist?

Guid? IDatabaseCommands.Head(string key)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Dec 27 2011, 5:41 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Tue, 27 Dec 2011 12:41:05 +0200
Local: Tues, Dec 27 2011 5:41 am
Subject: Re: [RavenDB] Re: Does document exist?

No, we will also send the metadata.

JsonDocumentMetadata IDatabaseCommands.Head(string key);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 5:47 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 02:47:34 -0800 (PST)
Local: Tues, Dec 27 2011 5:47 am
Subject: Re: [RavenDB] Re: Does document exist?

Ack


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 8:50 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 05:50:52 -0800 (PST)
Local: Tues, Dec 27 2011 8:50 am
Subject: Re: [RavenDB] Re: Does document exist?

I have it implemented and tested except for one problem..  I wasn't getting
a Last-Modified value when using DocumentStoreServer.

In Raven.Database.Server.Responders.Document.Head(), last line:

    context.WriteHeaders(documentMetadata.Metadata,
documentMetadata.Etag.Value);

...the documentMetadata.LastModified is ignored / omitted. Was this
intentional? This means the metadata when using DocumentStoreEmbedded had a
LastModied value, but DocumentStoreServer did not.

As you may see from my pull request (
https://github.com/ravendb/ravendb/pull/416/files#L4R127 ) , I've added a
hack to fix this (if it wasn't intentional). Let me know if there is a
better way.

Cheers

- Damian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Dec 27 2011, 9:03 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Tue, 27 Dec 2011 16:03:48 +0200
Local: Tues, Dec 27 2011 9:03 am
Subject: Re: [RavenDB] Re: Does document exist?

I'll look at that tomorrow, in the mean time, I need your CLA, see here:
http://ravendb.net/faq/contributing


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damian Hickey  
View profile  
 More options Dec 27 2011, 11:22 am
From: Damian Hickey <dhic...@gmail.com>
Date: Tue, 27 Dec 2011 16:22:40 +0000
Local: Tues, Dec 27 2011 11:22 am
Subject: Re: [RavenDB] Re: Does document exist?

I've already signed and submitted a CLA for a previous contribution. Do I
need to do so again?
On Dec 27, 2011 2:04 p.m., "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Dec 28 2011, 6:54 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Wed, 28 Dec 2011 13:54:22 +0200
Local: Wed, Dec 28 2011 6:54 am
Subject: Re: [RavenDB] Re: Does document exist?

No, I didn't check that, thanks, I'll look at that shortly.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Jan 1 2012, 6:40 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Sun, 1 Jan 2012 13:40:29 +0200
Local: Sun, Jan 1 2012 6:40 am
Subject: Re: [RavenDB] Re: Does document exist?

Pulled

On Wed, Dec 28, 2011 at 1:54 PM, Oren Eini (Ayende Rahien) <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 30   Newer >
« Back to Discussions « Newer topic     Older topic »