That is great you worked on this and got it going for your needs. I
would suggest creating a jira issue and linking/watching these:
https://jira.mongodb.org/browse/SERVER-4900
https://jira.mongodb.org/browse/SERVER-340
On Thu, Sep 6, 2012 at 2:15 AM, R.B. Boyer <
are...@nexusvector.net> wrote:
> +1
>
> I frequently find myself in the same boat, wanting to set things like a
> "date_created" field on a doc but only on insert. I would love a feature
> like this.
>
>
> On Wednesday, September 5, 2012 3:38:48 PM UTC-7, Stephen Cuppett wrote:
>>
>> I opened pull request #298 a few days ago
>> (
https://github.com/mongodb/mongo/pull/298)
>>
>> I was implementing a rate limiting and counting collection and found I
>> needed a way to upsert and provide "initial-only" values.
>>
>> The code to modify was straightforward enough and works good insofar as my
>> use case requires. Does anyone else have any opinions? Ideally, an entire
>> language construct similar to the behavior of MERGE INTO would be very
>> useful (one set of values for the update operation with potentially a
>> disjoint set of values when it is not found) at the atomic level. However,
>> for now, $setIfAbsent works good enough for me.
>>
>> I wasn't sure what other assets to provide along with the pull request. I
>> can work on unit tests, additions to the doc, etc. IOW, I will support
>> whatever it takes to get the code added correctly.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-dev" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/mongodb-dev/-/sGiPF7DiMcEJ.
>
> To post to this group, send email to
mongo...@googlegroups.com.
> To unsubscribe from this group, send email to
>
mongodb-dev...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/mongodb-dev?hl=en.