flags value (decimal) | flags value (binary) | bits #[5,6,7,8] | decimal | type | note |
---|---|---|---|---|---|
16777216 | 00000001000000000000000000000000 | 0001 | 1 | Private | couchbase docs example |
33554432 | 00000010000000000000000000000000 | 0010 | 2 | JSON | couchbase docs example |
33554438 | 00000010000000000000000000000110 | 0010 | 2 | JSON | default from http rest api |
50331648 | 00000011000000000000000000000000 | 0011 | 3 | Raw Binary | couchbase docs example |
67108864 | 00000100000000000000000000000000 | 0100 | 4 | Non-JSON String | couchbase docs example |
67108868 | 00000100000000000000000000000100 | 0100 | 4 | Non-JSON String | extra 'JSON.stringify(entry)' with nodejs official sdk |
Last active
January 30, 2024 20:48
-
-
Save capslocky/aad2e8e617a9225639fbaa3a92a8ba1c to your computer and use it in GitHub Desktop.
Couchbase metadata Common Flags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --request POST 'http://host:8091/pools/default/buckets/my-bucket/docs/123' \ | |
--header 'Content-Type: application/x-www-form-urlencoded' \ | |
--header 'Authorization: Basic XXX' \ | |
--data-urlencode 'value={ "name": "John"}' \ | |
--data-urlencode 'flags=67108864' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// how to convert values in browser console | |
0x02 << 24 | |
// 33554432 | |
(33554432).toString(2).padStart(32, '0') | |
// "00000010000000000000000000000000" | |
"00000010000000000000000000000000".substring(4, 8) | |
// "0010" | |
parseInt("0010", 2) | |
// 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment