Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Readme
Solr nodejs wrapper, mongoose inspired
You should install solr server
solr create_core -c querytest
solr create_core -c products
npm install --save solwr
npm run test
Performing create core, you should create core on server
solwr.address( {
host: "http://<ip or domain>",
port: <port>
} );
solwr.core(<core_name>, <opts>)
// return core
var users = solwr.core('users');
you try duplicate core throw duplicate error.
opts
* wt //request and respones type (json, xml)
users.removeCore()
.exec()
.then(<success_callback>)
.then(null, <error_callback>);
alternatively
users.removeCore(function(err, data){
if(err) handle err
});
users.create({id: '1', name: 'omer'}, <opts>)
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
//document array
users.create([{id: '1', name: 'omer'}, {id: '2', name: 'markakod'}], <opts>)
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
this alternative is usable all of query
users.create({id: '1', name: 'omer'}, function(err, data){
if(err) handle err
});
opts
* dataFormat //json, xml
//get documents by query
users.find("*:*", <opts>)
.exec()
.then(function(_users){
//use response users
})
.then(null, function(err){
//handle error
})
opts
* format //json, xml
//if you want only data, response contains
users.find("*:*", <opts>)
.only()
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
opts
* format //json, xml
xml response is not parsed, is string
//get documents by query
users.find("*:*")
.sort("id desc")
.only()
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
opts
* format //json, xml
//get documents by query
users.find("*:*", <opts>)
.limit(4)
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
opts
* format //json, xml
//get documents by query
users.find("*:*", <opts>)
.skip(100)
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
if you want, you can pagination with skip and limit functions
opts
* format //json, xml
//get documents by query
users.remove("id:1", <opts>)
.exec()
.then(<success_callback>)
.then(null, <error_callback>)
opts
* format //json, xml
heavily inspired by mongoose
MIT
FAQs
solr wrapper for nodejs
The npm package solwr receives a total of 0 weekly downloads. As such, solwr popularity was classified as not popular.
We found that solwr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.