[CDRIVER-165] BCON Notation for insert key/value only when value meets condition Created: 02/Aug/12 Updated: 19/Oct/16 Resolved: 30/Aug/12 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 0.6 |
| Fix Version/s: | 0.7 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Samuel Chou | Assignee: | Gary Murakami |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Hi gjmurakami, BCON looks amazing, thanks for writing this! I see the potential of much clearer C code in our futures =). Looking at how we currently use libmongoc, it looks like we can't switch over to BCON because we have many places in our code where we test if the value passes a condition before we insert the key/value pair. Simple example:
I wonder if it would be possible to somehow satisfy this use case as well. The BCON spec is nice and clean, and I don't really have a solution in mind that wouldn't clutter it up somehow. Some food for thought, I guess =). Sam |
| Comments |
| Comment by Gary Murakami [ 30/Aug/12 ] | ||||||||||||||||||||||||||
|
Resolving, please reopen if there is a remaining issue, or open a new ticket. | ||||||||||||||||||||||||||
| Comment by Gary Murakami [ 17/Aug/12 ] | ||||||||||||||||||||||||||
|
Sam: Glad to help. Please let me know how it works out, so we can close out this ticket, or add work items to satisfy it. Blessings, -Gary | ||||||||||||||||||||||||||
| Comment by Samuel Chou [ 16/Aug/12 ] | ||||||||||||||||||||||||||
|
Hi Gary, Sorry for taking so long to respond. This looks great! I'm really excited... thanks for simplifying our use case. Sam | ||||||||||||||||||||||||||
| Comment by Gary Murakami [ 09/Aug/12 ] | ||||||||||||||||||||||||||
|
Sam: Please let me know what combinations of the above work for you, and any other feedback is welcome and solicited. Blessings, -Gary | ||||||||||||||||||||||||||
| Comment by Gary Murakami [ 09/Aug/12 ] | ||||||||||||||||||||||||||
|
Experimental conditional element interpolation for int32 and int64. | ||||||||||||||||||||||||||
| Comment by auto [ 09/Aug/12 ] | ||||||||||||||||||||||||||
|
Author: {u'date': u'2012-08-09T13:44:16-07:00', u'email': u'gary.murakami@10gen.com', u'name': u'Gary Murakami'}Message: | ||||||||||||||||||||||||||
| Comment by Samuel Chou [ 07/Aug/12 ] | ||||||||||||||||||||||||||
|
Hi Gary, Wow, thanks for responding so quickly! For our simple use case, this might be too complicated. At a glance, would we probably have to do something like:
| ||||||||||||||||||||||||||
| Comment by Gary Murakami [ 06/Aug/12 ] | ||||||||||||||||||||||||||
|
Sam: Also, I recently ran the performance tests again with -O3 and found only a 1.1 to 1.2 X cost overhead. Blessings, -Gary | ||||||||||||||||||||||||||
| Comment by Gary Murakami [ 06/Aug/12 ] | ||||||||||||||||||||||||||
|
diff for special function interpolation |