{"id":21182529,"url":"https://github.com/dvshu/phql","last_synced_at":"2026-04-27T11:31:01.946Z","repository":{"id":57323278,"uuid":"178166032","full_name":"DvShu/phql","owner":"DvShu","description":"Convert a string of a specific format to the data filter parameter form of MongoDB.","archived":false,"fork":false,"pushed_at":"2019-03-28T09:46:39.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T03:16:26.806Z","etag":null,"topics":["filter","mongodb","phql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DvShu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-28T09:04:57.000Z","updated_at":"2019-03-28T09:46:41.000Z","dependencies_parsed_at":"2022-09-21T00:51:39.911Z","dependency_job_id":null,"html_url":"https://github.com/DvShu/phql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DvShu%2Fphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DvShu%2Fphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DvShu%2Fphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DvShu%2Fphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DvShu","download_url":"https://codeload.github.com/DvShu/phql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639211,"owners_count":20323505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter","mongodb","phql"],"created_at":"2024-11-20T17:57:18.434Z","updated_at":"2026-04-27T11:31:01.897Z","avatar_url":"https://github.com/DvShu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phql\nConvert a string of a specific format to the data filter parameter form of MongoDB.\n## English\n### Installation\n```NodeJs\nyarn add phql\n```\n### Usage\nUsually used for client dynamic acquisition of required fields in web applications.\n```NodeJs\nlet parseQl = require('phql');\nlet filterObj = parseQl('{name,age,sex,info{weight,height}}')\n```\n### Specific Format String\n```\n{name,age,sex,info{weight,height}}\n```\n### Parsed Result\n`MongoDB` [projections](http://mongodb.github.io/node-mongodb-native/3.2/tutorials/projections/ \"projections\")\n```javascript\n{\n  name: 1,\n  age: 1,\n  sex: 1,\n  info: {\n    weight: 1,\n    height: 1\n  }\n}\n```\n## 简体中文\n通常用于在使用 `MongoDB` 的 `WEB` 应用程序中，客户端动态获取自己所需要的字段；这个时候客户端可以传递特定格式的字符串，然后服务端解析该字符串为 `MongoDB Projections` 的形式传递给 `MongoDb` 。\n# License\n[MIT](https://github.com/DvShu/phql/blob/master/LICENSE \"MIT\")\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvshu%2Fphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvshu%2Fphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvshu%2Fphql/lists"}