Last active
August 29, 2015 14:22
-
-
Save paomian/b24b7c0548a910b5d2c8 to your computer and use it in GitHub Desktop.
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
;; hash map 数据处理 | |
(pre-process {:deviceToken "abcdefghi" :channel ["a" "b" "c"]} | |
[:deviceToken :channel :_Installattion] nil) | |
[{ | |
"_Installattion<>":"", | |
"channel":["a","b","c"], | |
"channel=a":1, | |
"channel=b":1, | |
"channel=c":1, | |
"deviceToken":"abcdefghi" | |
} 0] | |
;; sort set 数据处理 | |
(pre-process {:deviceToken "abcdefghi" :channel ["a" "b" "c"] :score 100} | |
[:deviceToken :channel :_Installattion] :score) | |
[100.0 { | |
"_Installattion<>":"", | |
"channel":["a","b","c"], | |
"channel=a":1, | |
"channel=b":1, | |
"channel=c":1, | |
"deviceToken":"abcdefghi" | |
}] | |
;;生成中间匹配字符串 | |
(json2str {:deviceToken {:$in ["a" "b"]}} "*") | |
("*deviceToken=a\":1*" "*deviceToken=b\":1*") | |
(json2str {:deviceToken "abcder"} "*") | |
"*deviceToken\":\"abcder*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment