StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.85k stars 1.5k forks source link

Create C# code snippets for bitfields #2607

Closed sav-norem closed 7 months ago

sav-norem commented 7 months ago

The redis.io webpage for bitfields needs the C# example as well. The python equivalent can be used to copy the setup and can be found here

The first line of the file needs to be the ID for the example - # EXAMPLE: bitfield_tutorial

Each separate section is delimited with a tag that you will need to copy exactly for it to appear in the correct place, ie.

# STEP_START bf
{code}                                    
# STEP_END

# HIDE_START, # HIDE_END, # REMOVE_START, and # REMOVE_END can be used for debugging and deleting keys. Hide will hide until a user expands the example, remove will only be seen in the source code and will never appear on the webpage.

@dwdougherty and I will be reviewing and tracking these issues - feel free to tag us with any questions

mgravell commented 7 months ago

Hmmm; somehow I think we've not added direct BITFIELD support yet, despite that being a 3.2 thing - we should fix thatz and I'm happy to repurpose this to do that. However, updating redis.io seems like a different repo, i.e. we literally can't do that from here

sav-norem commented 7 months ago

@mgravell I can tag @uglide to explain how it all works, but I thought this was the appropriate repo since it works just fine from the NRedisStack - https://github.com/redis/NRedisStack/pull/197 - here's one that Steve did to add in a different data type. Is NRedisStack the correct repo instead of this one?

sav-norem commented 7 months ago

actually that probably means that NRedisStack is the only place it will work from - I'll move these over there.

mgravell commented 7 months ago

We should still add direct support - it is more efficient and obvious that having to use an extension.

slorello89 commented 7 months ago

FYI @mgravell #2107 (never did get around to figuring out the API design)