public class Server2 {
public static void main(String[] args) throws IOException {
System.out.println("Server is starting……");
ServerSocket server=new ServerSocket(8888);
while(true){
Socket s =server.accept();
System.out.println("Accepting connection……");
new ServerThread(s).start();
}
}
}
//定义Server线程
模糊查询要用到re模块
import pymongo
import re
.........
#查询name字段中包含abc关键的数据
mycol.find({"name":re.compile('abc')})