array of allowUnknownTags doesnt work - jsdoc

I have the latest of JsDoc (3.4.3), and as per the documentation of JsDoc, I added array of unknown tags, but got slapped with error of unknow tag
The #foo: tag is not a known tag.
"allowUnknownTags": [ "foo", "usage", "test" ]
Am I missing something ?
Am I expected to write customTag plugin ?

allowUnknownTags takes a boolean, not an array.
[...]
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
[...]
See this question & answer "create custom tags with jsdoc" for more about defining your own tags in a custom dictionary*.
*: Maybe... I don't really know, but it seems about right.
http://usejsdoc.org/about-configuring-jsdoc.html

Related

Multi-line problem matcher algorithm clarification - rollup matcher not working as expected

Can anyone clarify the exact algorithm used for the VS code multi-line problem matcher? Specifically curious what the behavior is when there are more than 2 patterns defined.
The context is that I'm trying to write a multi-line problem matcher in VS Code for a rollup task. A sample of the output would look like:
(!) Plugin typescript: #rollup/plugin-typescript TS2345: Argument of type 'FirstType' is not assignable to parameter of type 'SecondType'.
Types of property 'PropertyOne' are incompatible.
Type 'FirstType' is missing the following properties from type 'PropertyOne': X, Y
src/main/pathToFile/file.ts: (174:37)
I've tried a number of options. Here's the most recent attempt:
"pattern": [
{
"regexp":"^[(][!][)](.*)$",
"message": 1
},
{
"regexp":"^\\s+(.*)$",
},
{
"regexp": "^([^:\\s]+):\\s+\\((\\d+):(\\d+)\\)$",
"file": 1,
"line": 2,
"column":3
}],
I would expect this to match the output described, but it doesn't match at all.
If I remove the first pattern, I'm able to get a match, but this doesn't give me all of the information I need.

What is the name of the "triple quoted string" property in vscode."editor.tokenColorCustomizations"

In Visual Studio Code, in the "settings.json" file, I am editing a color theme, and need a way to describe the property for triple quoted strings seen in functions as comments:
"editor.tokenColorCustomizations": {
"[Starfall Palenight]": {
"comments": "#82bdd1",
"strings": "#75ec9d"
}
},
The attempt to use "comments" fails, as this property only applies to real comments, and "strings" only affects normal strings.
An example of what my desired comment would look like is shown below:
def func():
'''this is the comment explaining how the function works'''
pass
Thank you

Mongoose Model.deleteMany() only deletes first element of matches

I'm trying to use the Model.deleteMany() function from mongoose. I'm trying to do something like this:
MyModel.deleteMany({"_id": {$in: ['objectid 1', 'objectid 2'
But this only deletes the first element of the matches from DB (in this case, if 'objectid 1' exists in the DB, it deletes that, but if it isn't nothing happens (both n and deletedCount is 0 in the returned data from the function). I tried using something other than the _id as a query, and this worked. If I had three elements with the same 'name' field, I could delete these.
I tried _id both with and without quotation marks. I also tried converting the object id strings to actual object ids before passing them to deleteMany, but this had no difference either. I have also of course tried to google this, but everything I've found are examples of usage, where it looks like I'm doing the exact same thing as the various blog posts.
I haven't added much code here because I don't really see what else I could be adding. I'm already printing out the input to the $in object, and this is correct. The strangest thing, I think, is that the first element of the list is deleted. Is it treated as a deleteOne request for some reason? are there any config options I need?
As per request, I've added the query and the documents I'd hope to delete:
//Request
MemberModel.deleteMany({"_id": {$in: [
5ee4f6308631dc413c7f04b4,
5ee4f6308631dc413c7f04b5,
5ee4f6308631dc413c7f04b6
]}};
//Expected to be deleted
[
{
"_id": "5ee4f62f8631dc413c7f04b5",
"firstName": "Name",
"lastName": "Nameson",
"__v": 0
},
{
"_id": "5ee4f62f8631dc413c7f04b6",
"firstName": "Other",
"lastName": "Person",
"__v": 0
}
]
If you have any ideas for what I could try, that would be much appreciated.

API $expand and &count

Is it possible to use $expand but instead of returning a collection of objects, just return the count of objects?
For example, get an account and a count of its annotations in a single WebApi call
I've tried a few things.
Obvious attempt: accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$expand=Account_Annotation($count=true) returns all fields of all Annotations but doesn't count anything.
Next I tried accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$expand=Account_Annotation($select=annotationid&$count=true) returns an error: "Found an unbalanced bracket expression". I think this is related to the & symbol in the $expand
I found a non-crm blog that said this could be resolved with a ; but when I tried accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$expand=Account_Annotation($select=annotationid;$count=true) it doesn't give an error, but the $count instruction seems to be ignored
A crazy attempt of accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$count=Account_Annotation($select=annotationid) returns a "not a valid count" error
I'm guessing that this is not a valid combination, but I thought I would post here in case someone else has achieved this successfully.
I got this working, but I'm not sure it's what you are looking for exactly, it only works if I put the count before expand:
api/data/v9.0/cmnt_salesexample?
$select=endcustomeraccountid&$count=true&$expand=endcustomerid($select=accountid)
output:
{
"#odata.context": "https://xyz",
"#odata.count": 5000,
"value": [
{
"#odata.etag": "W/\"3560581422\"",
"endcustomerid": "54321"
},
{
"#odata.etag": "W/\"3510396844\"",
"endcustomerid": "12345"
},
...

MongoHub remove data

Looked everywhere online and can't find a simple answer to how to delete an id from MongoDB using MongoHUB.
In MongoHub I click on remove and i get presented with this above the query box:
db.site.markets.remove()
i want to remove this data:
{
"_id": 10,
"item": "box",
"qty": 20
}
Surely this code should work?
db.site.markets.remove(item : 'box' )
or
db.site.markets.remove(_id : 10)
Both of them don't work.
I'm making this too difficult... Stupid though it may sound a right click, delete function would be helpful...
When removing using mongohub you must wrap the parameters in quotes.
{"item" : "box"}
Also when removing by mongodb built in id the ObjectId() function is also required.
{ "_id" : ObjectId( "12345")}
You should give an object to mongodb. And _id column generated by mongodb is type of ObjectId, so you should use ObjectId("10") when passing the parameter as below:
db.site.markets.remove({item : 'box'})
db.site.markets.remove({_id : ObjectId('10')})