Meteor: Regarding transform in the collections allow-method - collections

When calling Collection.allow(options), the docs says this about the parameter options.tranform:
Overrides transform on the Collection. Pass null to disable
transformation.
When I pass options.transform=null, the transform given when the collection is created is still used. I interpret the documentation as no transform function at all will be used if options.transform=null.
So, is it the documentation, my interpretation of the documentation or Meteor that should be fixed?
I'm using Meteor 0.6.4.1.

This is fixed in Meteor 0.7:
Fix passing transform: null option to collection.allow() to disable
transformation in validators. #1659
https://github.com/meteor/meteor/blob/devel/History.md

Related

what is the use of first argument of createAsyncThunk?

I'm new in redux toolkit and I've managed state with redux toolkit lately. But the thing I don't know, what is usage of first argument of CreateAsyncThunk. I've read this article: https://redux-toolkit.js.org/api/createAsyncThunk and according to this, CreateAsyncThunk has two argument and first argument is named type :
A string that will be used to generate additional Redux action type constants, representing the lifecycle of an async request
Ok. But we never need to call or use this argument again, so why is important to name this argument? I tried adsfds insted of requestStatus after / and my project worked perfectly! I also understand it also works even without slash.
It seems it doesn't matter what you write as first argument, It always works! So what is the usage of the first argument?
In Redux, every action is identified by a unique type string. So createAsyncThunk creates three actions for you - in your case with the type strings "adsfds/pending", "adsfds/fulfilled" and "adsfds/rejected".
If you do not use "asdfds" in any other createAsyncThunk, that's a perfectly fine thing to do, but if you look at the Redux Devtools browser extension to see what is happening in your application, a string like that might make it very difficult to read.

How to generate operation documentation at run time?

Can you set Swashbuckle documentation for an Operation at runtime?
Example: document list of values that are allowed, which is based on an internal dictionary but could also be based on configuration.
What does not solve the problem:
Use XML documentation: sets documentation from the XML comments in code. This is static instead of dynamic.
Set global description using the AddSwaggerGen method. This is dynamic, but at the wrong level.
Using an ISchemaFilter you can do some crazy documentation.
Here is an example:
https://github.com/heldersepu/csharp-proj/blob/master/WebApi_MyGet/WebApi_MyGet/App_Start/SwaggerConfig.cs#L277

Revit API: 'Hidden' methods?

While using Revit API and browsing the "RevitAPI.chm" file (and browsing examples on the internet), I have noticed that some methods exist while not being listed neither in the "RevitAPI.chm" file nor suggested when using RevitPythonShell.
I explain. Let's say for instance that I have a "Space" Object, obtained with
s = FilteredElementCollector(doc).OfClass(SpatialElement).ToElements()
If I do, let's say (assuming s[0] is a valid Space object):
s[0].Geometry
I got an 'indexer object':
<indexer# object at 0x0000000000000049>
But if I do:
s[0].get_Geometry(Options())
Then I got my GeometryElement object. The same behavior goes with get_BoundingBox, for instance.
Now, that's fine, but the only way I could know about these get_something methods is by seeing examples (either on the "RevitAPI.chm", or on forums etc.). So that's kind of strange, isn't it? In the sense that these methods aren't actually listed.
So I guess my questions would be:
Is it the normal behavior? (or should I normally just get a GeometryElement object by using s[0].Geometry, for instance?)
If yes, ... why ? :D
What are these 'indexers' ?
Thanks!
Arnaud.
PS: Using Revit 2017, tests made with RevitPythonShell and pyRevit
The methods prefixed by a lowercase get_ are automatically generated getter methods. The official Revit API provides and documents the BoundingBox property on the Element class. Rather inelegantly, this so-called property takes an argument. Therefore, the C# .NET implementation generates a property getter function for it.

DataService.commitRequiredOn() recursive check?

We're using LCDS and the "commitRequiredOn" method in the DataService class to check if there are pending changes for an entity. However, it seems like "commitRequiredOn" does not check the complete graph of an object, but just the object itself. For now, we have implemented a recursive check on the complete object graph, but this seems like functionality that should come out of the box.
Am I missing something here, or is there just no built-in way to recursively check an entity to see if it's dirty or not?
I can confirm that commitRequiredOn is checking only the objects itself. But there is also the property DataService.commitRequired (and this is checking for all the objects managed by the dataservice) - maybe you can use it.

Meteor collection schema: how to turn off data cleaning?

I use the aldeed:collection2 package, and I attached a schema to my Meteor collection. It automatically performs data validation upon every insert/update. However, before inserting anything into the collection, it simply removes data fields that weren't declared in the schema.
I know I can turn this off by specifying filter: false:
MyCollection.insert(newDocument, { filter: false });
But I want it to be turned off by default, so I won't accidentally screw up my database by forgetting to update my schema.
How to turn off data filtering by default?
The .clean method gets always called, as stated in the SimpleSchema docs, therefore I don't think it's possible to disable that by default as you are asking:
NOTE: The Collection2 package always calls clean before every insert, update, or upsert.

Resources