Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
"$in" 方法需要一个数组,而有问题的列是一个字符串,所以我需要使用 jQuery 从这里开始:
[123,456,789]
对此:
["123,"456","789"]
干得好。我认为不需要太多解释:
arr = $.map(arr, function(val) { return val.toString(); });
如果你有浮点值而不是整数,你可能想要使用.toFixed [MDN]方法而不是调用.toString().
.toFixed
.toString()