Search Docs
compare()
将此ObjectId与另一个比较,并返回一个数字表示它们的相对排序顺序。
import { ObjectId } from 'funtool'; const id1 = new ObjectId(); const id2 = new ObjectId(); const result = id1.compare(id2); // -1, 0 或 1
compare(other: ObjectId): number
other
返回:
-1
0
1